简体   繁体   中英

JMeter - How can I capture values from Response data and add them in the same CSV results file that is used to generate HTML reports

I need to capture some values from Response data and add them to the same CSV file which is used to generate HTML reports (not to a separate CSV file). The reason I want to do this is to filter the Response times by any value I capture, in this case LOBs or GroupIDs (last 2 columns). In the picture, column A thru P are from JMeter generated results, but I want to add column Q and R also with captured values.

Results

  1. Add a suitable Post-Processor to extract LOBs and GroupIDs , make sure to use exactly the same variable reference name:

    在此处输入图像描述

  2. Add the next line to user.properties file:

     sample_variables=LOBs,GroupIDs
  3. That's it, next time you start JMeter you will see 2 extra columns added to the.jtl results file containing variable values for each Sample Result.

If you don't want to make the change permanent instead of adding the above line to the user.properties file you can pass it via -J command-line argument like:

jmeter -Jsample_variables=LOBs,GroupIDs -n -t test.jmx -l result.jtl

References:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM