3

I am wanting to achieve the following in JMETER

  1. Jmeter loads CSV file with id numbers
  2. Each user/thread in Jmeter picks a id number and adds it to their HTTP request e.g. http:www.testsite.com/test.php?id=x
  3. Repeat step 2 , selecting the next id number in the file.

This is so I can test that my servlet is performing multiple threads with connection pooling.

I have tried manually entering in values hereenter image description here

However this is not working.

Schema Layout:

enter image description here

Thanks

tomaytotomato
  • 3,788
  • 16
  • 64
  • 119

1 Answers1

8

You can try to implement your schema as below:

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

id1
id2
...
idN

2. Use the following schema:

CSV Data Set Config
Filename: [path to your csv-file with test-IDs]
Variable Names: testID  // extracted id can be referred as ${testID}
Recycle on EOF? False
Stop thread on EOF? True
Sharing mode: Current thread // this mode allows EACH thread use ALL values from csv
Thread Group
Number of Threads: N    // count of your test-threads (users)
Loop Count: Forever
. . .
    HTTP Request // your http call
    Server Name or IP: www.testsite.com
    Path: /test.php?id=${testID} // use variable with extracted ID
. . .
Aliaksandr Belik
  • 12,725
  • 6
  • 64
  • 90
  • thanks - I have tried your schema layout but when I click start it does not run the test. Please see the updated question – tomaytotomato Nov 12 '12 at 11:36
  • 3
    Simply implement schema as per answer above: 1. CSV Data Set Config should be placed BEFORE Thread Group in test-plan; 2. use HTTP Request sampler (http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Request) to sent your requests; HTTP Request Defaults config is the way to set only common part for all the requests - e.g. Server Name (not the Path). – Aliaksandr Belik Nov 12 '12 at 11:53