Jmeter Selenium WebDriver Stop test

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Jmeter Selenium WebDriver Stop test

UserJMeter999
I'm trying to stop the test if one of the sampler fails.But test is not
stopped instead it continues with next sampler execution.
Code looks like this

if(results.empty) {
    WDS.sampleResult.successful = false
    WDS.sampleResult.sampleEnd();
    WDS.sampleResult.setStopTest(true);
}
else
{
WDS.sampleResult.sampleEnd();
WDS.log.info("Sample Ended - SUCCESS");
}
Reply | Threaded
Open this post in threaded view
|

Re: Jmeter Selenium WebDriver Stop test

shettyd
Any reason why you are not setting this on the thread group ?
https://jmeter.apache.org/usermanual/component_reference.html#Thread_Group
- Action to be taken after sampler error

If you still want to do it in code , Im guessing the method also should be
on the thread group not on the sample result .

On Thu, Nov 8, 2018 at 10:03 AM JMeter User <[hidden email]> wrote:

> I'm trying to stop the test if one of the sampler fails.But test is not
> stopped instead it continues with next sampler execution.
> Code looks like this
>
> if(results.empty) {
>     WDS.sampleResult.successful = false
>     WDS.sampleResult.sampleEnd();
>     WDS.sampleResult.setStopTest(true);
> }
> else
> {
> WDS.sampleResult.sampleEnd();
> WDS.log.info("Sample Ended - SUCCESS");
> }
>