ngrinder
›
ngrinder-user-cn
Search
everywhere
only in this topic
Advanced Search
如何读取文件中多个待压测的url,然后一个一个执行
Classic
List
Threaded
♦
♦
Locked
3 messages
chenmeiling
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
如何读取文件中多个待压测的url,然后一个一个执行
sitmd2012
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: 如何读取文件中多个待压测的url,然后一个一个执行
1.定义一个全局变量
public static String[] text
2.在beforeProcess()中读取配置文件
text = Util.readFileString("./resources/url.txt", "utf-8")
3.在test()中使用
int index = (int) (Math.random() * text.length);
text[index] 就是要用的url
yu.zhai
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: 如何读取文件中多个待压测的url,然后一个一个执行
In reply to
this post
by chenmeiling
有目录的文件会出现,读取不到文件的情况吧
Free forum by Nabble
Edit this page