Can any one help me how to save HTML response (including screen images) from View Results Tree listener using JMeter?
I can store the results in csv but my main objective is to store the screen images that are displayed in view results tree
The screenshot name should be stored under step name (eg: TC002 Account Menu)
You can add JSR223PostProcessor and save response body to the file. For example like this:
File file = new File(pathToYourFile);
FileWriter fstream= new FileWriter(file,true);
BufferedWriter out = new BufferedWriter(fstream);
out.write(prev.getResponseDataAsString());
out.close();
fstream.close();
If you want each answer to be saved in a different file, you will need to add code to create the files and add them a new uniq name.
UPD One way to save each response in your own file is to generate the name depending on the value of the counter like this: (Using JMeter Functions)
def filename = "${__counter(FALSE,)}" + "response.html";
File file = new File("C://JmeterResultFolder//"+filename);
or this: (Using Counter Sampler)
def filename = "${counter}" + "response.html";
File file = new File("C://JmeterResultFolder//"+filename);
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments