Search code examples
jmeterperformance-testingjmeter-pluginsjmeter-5.0

How to show Request data in Summary report and HTML dashboard report in JMeter


I want to show the request data which is passed in post API in the Summary report and HTML dashboard report. For Eg. If the Login API is hit then baseURL/api/auth/users/login Input Data : { "Email" : "[email protected]", "Password" : "Abc123"} I need to show { "Email" : "[email protected]", "Password" : "Abc123"} this data in summary report and HTML dashboard report.


Solution

  • As per JMeter 5.4.1 it's not very possible without massive changes to JMeter Source code

    Moreover I doubt the functionality will ever be implemented because you should reduce resource requirements to the absolute minimum

    If for some reason you still need to have the request data information somewhere in the report the only option I can think of is adding the request data to the Sampler label, something like:

    1. Add JSR223 PostProcessor as a child of the request which data you need to store (or if you want to store the data for all Samplers - put the JSR223 PostProcessor at the same level with the Samplers, see JMeter Scoping Rules - The Ultimate Guide for more details)

    2. Put the following code into "Script" area:

      prev.setSampleLabel(prev.getSampleLabel() + ': ' + prev.getSamplerData())
      

      enter image description here

    This is what you will get in the Summary Report listener:

    enter image description here

    and this is how will HTML Reporting Dashboard look like:

    enter image description here