I am using CSV file which contains variables for my XML requests. I know how to see the request sent, but I would like to save each request in
Add > Listers> View Result Tree In result tree click on config button and check the type of data thats has to be stored and provide the link to csv file. Check the snapshot for more info.
Hope this helps.
The easiest way seems to be using Flexible File Writer, you can save requestData
into a file.
If you need more flexibility - for HTTP Request samplers you can do it with Beanshell Listener like:
Put the following code into the Listener's "Script" area
import org.apache.commons.io.FileUtils;
String data = ctx.getCurrentSampler().getArguments().getArgument(0).getValue();
int threadNum = ctx.getThreadNum();
int loop = ctx.getVariables().getIteration();
FileUtils.writeStringToFile(new File("request-" + threadNum + "-" + loop + ".txt"),data);
You'll get files like request-x-y.txt
generated in JMeter's "bin" folder where:
x
- JMeter Thread Numbery
- Current Loop Iteration (Thread Group level) See How to Use BeanShell: JMeter's Favorite Built-in Component article for more information on using Beanshell in JMeter tests.
you should save the results as XML and turn on only the "Save Sampler Data (XML)"