Writing JMETER Variables into external file

Writing JMETER Variables into external file

  • perf-test.com need your contributions to build up a strong repository of performance engineering resources.

While working for a data scraping project using Jmeter, we wanted to write up the variables into an external csv file. Task was accomplished by performing following tasks

Add a BSF PostProcessor - Add following lines

FileWriter fstream = new FileWriter("e:\\test1\\test2\\results.txt",false);
BufferedWriter out = new BufferedWriter(fstream);

int temp3 = Integer.parseInt(vars.get("Store_matchNr"));

for(int i = 1; i < temp3 ; i++)
{
temp1 = vars.get("Store_"+i+"_g1");
temp2 = vars.get("Store_"+i+"_g2");
out.write(temp1);
out.write(",");
out.write(temp2);
out.newLine();
out.flush();
}
out.close();​
Author
admin
Views
46
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from admin