PreProcessor: Skip only current sampler execution if condition is not
Here is my Jmeter structure.
Thread Group
Sampler 1
Pre-Processor 1
Sampler 2
I am checking the condition in "Pre-Processor 1". If that fails, I want to skip executing "Sampler 1" along with any post processor and assertions and move on to the next Sampler. How can we do this?
I know that I can do this in the sampler before "Sampler 1" and wrap "Sampler 1" around the IF controller to test it. But I don’t want that. I am looking for a solution like ctx.setRestartNextLoop (true); which will move on to the next iteration. Instead, I want to skip just the current sampler.
source to share
In JMeter core, it is not expected that the Pre-Processor can cancel the Sampler execution, make an extended query describing your specific need, as I don't understand the motivation.
In the meantime, take the alternative approach based on IfController.
Use the "if controller" element, it will run your Sampler 1 only if the condition is true:
source to share