RJM
RJM

Reputation: 311

How to display the variable value in the summary report

For each sampler result I have a variable value which I want to show it in the summary report as a test result. How to write this value in the jtl file and show it in the summary report?

Upvotes: 0

Views: 2281

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

You can write the variable into a file using sample_variables property.

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

    sample_variables=foo
    

    replace foo with your actual variable name

  2. Restart JMeter to pick the property up
  3. That's it, an extra column will be added to the .jtl results file holding the foo variable value for each SampleResult

With regards to displaying it in the summary report, this is not something you can do out of the box, however you can plot the variable value as a chart in the HTML Reporting Dashboard. If this is something you're interested in - add the next lines to user.properties file:

jmeter.reportgenerator.graph.custom_testGraph.classname=org.apache.jmeter.report.processor.graph.impl.CustomGraphConsumer
jmeter.reportgenerator.graph.custom_testGraph.title=Foo values
jmeter.reportgenerator.graph.custom_testGraph.property.set_Y_Axis=Foo values
jmeter.reportgenerator.graph.custom_testGraph.set_X_Axis=Over Time
jmeter.reportgenerator.graph.custom_testGraph.property.set_granularity=60000
jmeter.reportgenerator.graph.custom_testGraph.property.set_Sample_Variable_Name=foo
jmeter.reportgenerator.graph.custom_testGraph.property.set_Content_Message=Foo value : 

again, replace foo with your actual JMeter Variable name

References:

Upvotes: 4

Related Questions