使用jmeter测试多个网站 [英] Use jmeter to test multiple Websites
问题描述
如何使用jmeter测试100个不同的网站(来自DMOZ)?
How to test 100 different websites (from DMOZ) using jmeter?
我认为可以通过将jmeter与脚本集成来完成.基本上,脚本是告诉jmeter从文本或csv文件中读取URL,并将http请求采样器更改为文件中的URL以运行测试,然后将测试结果保存到文件中.
I think it can be done by integrating jmeter with a script. Basically the script is to tell jmeter to read the URLs from a text or csv file and changing the http request sampler to the URLs from the file to run the test and then save the test result to a file.
有什么主意吗?
推荐答案
您可以按照以下几点来实现:
You can possibly implement this as per the following points:
1..在csv文件中准备测试网址,例如格式如下:
1. Prepare your test-urls in csv-file, e.g. in the following format:
url1
url2
...
urlN
2..为脚本使用架构,如下所示:
2. Use schema for your script as below:
Thread Group
. . .
While Controller
Condition: ${__javaScript("${testURL}"!="<EOF>",)} // read csv-file until the EOF
CSV Data Set Config
Filename: [path to your csv-file with test-urls]
Variable Names: testURL
Recycle on EOF? False
Stop thread on EOF? True
Sharing mode: Current thread group
HTTP Request // your http call
Server Name or IP: ${testURL} // use variable with extracted URL
. . .
3..要保留测试结果,您可以使用例如将响应保存到文件或配置 jmeter的即用型监听器.
3. To retain test-results you can use e.g. Save Responses to a file or configure Sample Result Save Configuration for any of the jmeter's out-of-the-box listeners.
这篇关于使用jmeter测试多个网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!