JMeter - stop thread from BeanShell preprocessor

Is it possible to stop Thread or force it to crash from Pre-Processer BeanShell ? I've tried accessing the "stop ()" function / method from the ThreadGroup class and a few others, but I'm not sure if I'm doing this correctly or if it's possible.

I wanted to force my test to stop in my PreProcessor BeanShell if this particular if statement inside my script resulted in TRUE ... Is this possible? I read a bit about the "Failure" and "FailureMessage" functions, but I wasn't sure what the end result was.

Any thoughts or suggestions would be greatly appreciated!

Thanks, Advance,
Matt

+3


source to share


1 answer


In a beanshell pre-processor, you can try this:

org.apache.jmeter.engine.StandardJMeterEngine.stopThread(Thread.currentThread().getName()); 

      

In mail processor beanshell:



if (condition) prev.setStopThread(true);

      

If you can express your state as if-controller

though I would rather use Test Action .

+3


source







All Articles