JMeter Beanshell (Save Dynamic Values in CSV, Exce, Txt)
JMeter Beanshell (Save Dynamic Values in CSV, Exce, Txt)
1. Save Single Dynamic Value to the File
String val1 = vars.get("C_AllStatus");
FileWriter fstream = new FileWriter("/SystemPath/Ref-Numbers.csv",true);
BufferedWriter out = new BufferedWriter(fstream);
out.write(val1 +"\n");
out.close();
fstream.close();
2. Save Multiple Dynamic Values to the File
String value1 = vars.get("P_UserName");
String value2 = vars.get("P_CIFNumber");
String value3 = vars.get("C_rrNumber");
String value4 = vars.get("C_FinalStatus");
FileWriter fstream = new FileWriter("/SystemPath/Ref-Numbers.csv",true);
BufferedWriter out = new BufferedWriter(fstream);
out.write(value1 +"," + value2 + "," + value3 + "," + value4+"\n");
out.close();
fstream.close();
Comments
Post a Comment