Manjunath Ramareddy
Manjunath Ramareddy

Reputation: 1

How to fetch FIRST value from CSV File1 & Iterate the HTTP sampler through multiple values from CSV File2 one by one until EOF of CSV File2?

I have a scenario like this..

One HTTP Sampler CSV File1 - en_gb, nl_nl CSV File2 - Fiat, Nissan, BMW

I want to test the HTTP sampler for the below combinations: First value of CSV File1 (en_gb), the sampler should loop through different values in CSV File2 like Fiat, Nissan, BMW, ..etc upto EOF

Next

Second value of CSV File1 (nl_nl), the sampler should loop through different values in CSV File2 like Fiat, Nissan, BMW, ..etc upto EOF

similarly... ... ... so on

How to achieve this in Jmeter? Appreciate your great help. Thanks

Upvotes: 0

Views: 36

Answers (1)

Dmitri T
Dmitri T

Reputation: 168072

Just use 2 CSV Data Set Config elements like:

  1. Add first CSV Data Set Config to read values like en_gb and configure it like

    enter image description here

  2. Then add a Loop Controller and configure it to loop as many times as there are lines in the 2nd CSV file, it can be done i.e. via __groovy() function like:

    ${__groovy(new File('file2.csv').readLines().size(),)}
    
  3. Then add another CSV Data Set Config to read values like Nissan and configure it like:

    enter image description here

  4. That's it, refer values as ${var1} and ${var2} where required

    enter image description here

Upvotes: 0

Related Questions