Exclude some samplers in JMeter html dashboard report in non gui mode

I have two http request samplers inside a Thread Group.

I would like to ignore the first sampler when I run the tests in non GUI mode (cli).

The main reason is to ignore the first sampler in the generated HTML report.

I still need the Sampler 1 to run under the hood even if I filter when running it in cli mode.

Upvotes: 3

Views: 2110

Answers (2)

Ori Marko
Ori Marko

Reputation: 58812

Send in non GUI extra parameter/JMeter property as -JignoreFirstSampler

Add JSR223 PostProcessor as a child of the first Sampler with code to ignore sampler in results:

    if (props.get("ignoreFirstSampler") != null) {
        prev.setIgnore()
    }

Sampler 1 will still executed, but won't be shown in report

Upvotes: 2

Dmitri T
Dmitri T

Reputation: 168122

  1. Put your HTTP Request samplers under the Transaction Controllers

    enter image description here

  2. Click Tools -> Export transactions for report

    enter image description here

  3. Amend generated jmeter.reportgenerator.exporter.html.series_filter property value and remove "unwanted" transactions

  4. Run JMeter in non-GUI mode and provide this jmeter.reportgenerator.exporter.html.series_filter property via -J command-line argument like:

    jmeter -Jjmeter.reportgenerator.exporter.html.series_filter="^(Sampler 2)(-success|-failure)?$" -n -t test.jmx -f -l result.jtl -e -o dashboard
    
  5. That's it, HTML Reporting Dashboard will contain only Sampler 2 transaction results

More information:

Upvotes: 0

Related Questions