JMeter change CSV file when current file reach its last data

Viewed 158

I have a script for stress test using JMeter, the problem is the data I will be using is too many that I needed to divide it to multiple CSVs.

Is it possible in JMeter to change the CSV file, the source of data if the file is at the last data ?

Example: I have 1 million data in CSV, during run-time when the iteration gets to the 1 million data it will change the file with newer data.

1 Answers

You can have multiple CSV Data Set Config with different variable names as id id1 id2

Mark as Recycle on EOF false

Recycle on EOF? Should the file be re-read from the beginning on reaching EOF? (default is true)

And when you will get to the end check value is EOF as "${id}" == "<EOF>" and override id/use ${id1} instead

Example:

if ("<EOF>".equals(vars.get("Email")){ 
   if ("<EOF>".equals(vars.get("Email2")){ 
      vars.put("Email",vars.get("Email3"));
      vars.put("Password",vars.get("Password3));
   } else {
      vars.put("Email",vars.get("Email2"));
      vars.put("Password",vars.get("Password2));
   }
}
Related