3
votes

Here is my Jmeter structure.

Thread Group
    Sampler 1
        Pre-Processor 1
    Sampler 2

I am checking a condition in 'Pre-Processor 1'. If it fails, I want to skip the execution of 'Sampler 1' altogether along with any post-processor and assertions and proceed to the next Sampler. How can we do this?

I am aware that I can do this in a sampler before 'Sampler 1' and wrap 'Sampler 1' around an IF controller to check this. But I don't want that. I am looking for a solution similar to ctx.setRestartNextLoop(true); which will go to the next iteration. Instead of that, I want to skip just the current sampler.

1

1 Answers

0
votes

In JMeter core, it is not expected that a Pre-Processor can cancel execution of Sampler, make an enhancetrequest describing your particular need as I don't understand the motivation.

Meanwhile, stick to your alternative approach based on IfController.

Use "if controller" element, It will run your Sampler 1 only if the condition is true: