Michele Scianatico
Michele Scianatico

Reputation: 7

Jmeter - extract different rows from csv for every thread for every iteration

Is there a way to extract from a CSV file two rows (need to give to a sample two rows parameters) and to give a thread and repetitions different rows? I mean first thread first repetition must take first and second row, second thread first iteration must take third and fourth row and so on. But then first user second iteration must take fifth and sixth row and second user second iteration must take 7th and 8th row and so on.

Upvotes: 0

Views: 1312

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

Go for __CSVRead() function

  • ${__CSVRead(test.csv,0)} - read first "column" from the test.csv file
  • ${__CSVRead(test.csv,1)} - read second "column" from the test.csv file
  • ${__CSVRead(test.csv,next)} - proceed to the next row

So if you do something like:

${__CSVRead(test.csv,0)} ${__CSVRead(test.csv,next)} ${__CSVRead(test.csv,0)} ${__CSVRead(test.csv,next)}

you will get the required behaviour.

Demo

enter image description here

used components:

More information: How to Pick Different CSV Files at JMeter Runtime

Upvotes: 1

Related Questions