jMeter foreach controller

BeanShell Sampler

1

String filePath = "path\\to\\your\\csv\\userdata.csv";

BufferedReader fbr = new BufferedReader(new FileReader(filePath));
String user;
int counter = 1;
while ((user = fbr.readLine()) != null) {
   vars.put("user_" + counter, user);
   counter++;
}
fbr.close();

ForEach Controller

2

HTTP Request

3

 

View Results Tree, csv input file and result

 

5

 

Author: bm on May 5, 2016
Category: jMeter