I'm facing some issue while creating the script to print input test data+response for that data. I want to print input test data also, for example:
cards
98765432
98765432
Results CSV file:should be
Cards,Results
98765432,PASS
98765432,FAIL
How can I print like above? My code is
import java.io.File;
import org.apache.jmeter.services.FileServer;
Result = "FAIL";
Response = prev.getResponseDataAsString();
if(Response.contains("fullCardNo"))
Result = "PASS";
fullCardNo =vars.get("fullcards");
f = new FileOutputStream("F:\\Java_Applications\\apache-jmeter-3.1\\bin\\FullCardsResults.csv",true);
p=new PrintStream(f);
this.interpreter.setOut(p);
p.println((${cards})+","+fullCardNo + "-" + Result);
f.close();
p.close();
By this above script,my results file showing empty, there is no data in that file.