You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by JMeter User <us...@gmail.com> on 2018/11/08 17:14:38 UTC

Jmeter Selenium WebDriver Stop test

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");
}

Re: Jmeter Selenium WebDriver Stop test

Posted by Deepak Shetty <sh...@gmail.com>.
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 <us...@gmail.com> 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");
> }
>