3

I have to make a load test for a relatively large number of users so I cant really use User Parameters pre-processor to parametrize each thread with custom user data. I've read that I should use CSV Data Set Config instead. However I run into a problem with how JMeter interprets the input of this Config.

Example:

I have a thread group of 3 threads and Loop Count:10 with one HTTP request sampler with server www.example.com and path: \${user}. The csv file (bullet is a single line in file) for CSV Data Set Config to extract the user parameter:

  • 1
  • 2
  • 3
  • 4
  • 5

Expected output is that for thread 1-x the path of the request should be: \x. So the output file should consist of 10 samples per thread namely:

  • for thread 1-1 : 10 requests to www.example.com\1
  • for thread 1-2 : 10 requests to www.example.com\2
  • for thread 1-3 : 10 requests to www.example.com\3

but instead i get requests to each \1 - \5 and then to EOF. Does anyone know how to achieve the expected effect with CSV Data Set Config in jmeter 2.9?

2

Figured it out:

Set thread group loop to 1. Enter a Loop Controller with desired number of loops after the CSV Data Set Config. Add the HTTP request sampler as a child of Loop Controller and you got it:)

Image of config:

enter image description here

| improve this answer | |
2

Case 1

When you know number of occurrences to be substituted in the existing request:

  • Take a loop counter define it with loop count as the number of occurrences you need to substitute.
  • Insert a CSV data set config as child into it and a Counter (this will generate that many occurrences variable.)
  • Use a beanshell to fetch the values from CSV data set config and assign it to variable generated by counter.
  • Outside the loop you can keep you sampler request which has the the values to be substituted.

Case 2

When you have number of occurrences to be substituted in the dynamic request

  • Take a loop counter define it with loop count as the number of occurrences you need to substitute fetched from previous sampler request
  • Insert a CSV data set config as child into it and a Counter (this will generate that many occurrences variable.)
  • Use a beanshell to fetch the values from CSV data set config and assign it to variable generated by counter.
  • Inside the loop you can keep you sampler request which has the the values to be substituted.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.