Search code examples
htmljmetercommand-line-interfacereportperformance-testing

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.


Solution

  • 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