In my service response output is just like as below :
6002:6005:93974309c3f042a69b20c9f9c38a13e3
there is no other things come in output ,it returns above value ,I want write this values into one local file for all requests.
In my service response output is just like as below :
6002:6005:93974309c3f042a69b20c9f9c38a13e3
there is no other things come in output ,it returns above value ,I want write this values into one local file for all requests.
Option 1: add the value to .jtl results file:
Add Regular Expression Extractor as a child of the request which returns this value and use the following Regular Expression Extractor configuration:
serviceResponse
(.*)
$1$
In user.properties file add the next line:
sample_variables=serviceResponse
Upon next execution you will see an extra column in your results .jtl file containing values extracted from the response. See Sample Variables chapter of JMeter's User Manual for more information.
Option 2: writing variables into a separate file
Put the following code into the PostProcessor's "Script" area:
import org.apache.commons.io.FileUtils;
FileUtils.writeStringToFile(new File("/path/to/your/file.txt"),new String(data) + System.getProperty("line.separator"), true);
The above code uses FileUtils.writeStringToFile() method to store the whole response into an arbitrary file. See How to Use BeanShell: JMeter's Favorite Built-in Component article for more information on using Java and JMeter API from Beanshell test elements in your JMeter test.
N.B. if you plan to produce high load go for option 1.