1

How to test 100 different websites (from DMOZ) using jmeter?

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.

Any idea?

Nanalove
  • 45
  • 1
  • 4

1 Answers1

1

You can possibly implement this as per the following points:

1. Prepare your test-urls in csv-file, e.g. in the following format:

url1
url2
...
urlN

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. 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.

Aliaksandr Belik
  • 12,725
  • 6
  • 64
  • 90
  • thank for your help but does not seem to be working for me. or do I write a code like you have above or use the GUI? – Nanalove Nov 10 '12 at 20:57
  • Any errors in console output or in jmeter.log? Check also path to your csv-file in CSV Data Set Config (either absolute or relative (but in this case csv should be placed in the same dir as your test-plan)). – Aliaksandr Belik Nov 11 '12 at 10:10
  • As well ensure that the test-URLs don't contain "http://" prefix (as per [HTTP Request params](http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Request_parms) -> Server). Works fine [as for me](http://cl.ly/0W1p2T1c0z1J). – Aliaksandr Belik Nov 11 '12 at 10:14
  • thank you for the answer. it was great. now do you know how to export the test result which I save in csv file to a mysql database? – Nanalove Nov 13 '12 at 23:03