vpachpute1
8 years agoFrequent Contributor
Execution is aborted if any Groovy step is failed in between
Hi
I have groovy scripts i between Test Steps.
But if any Groovy script fails, further execution is stopped.
Note: In Options: I have unchecked Abort Test if an error occurs. PFA of same
Can you please tell me if any specific option wrt Groovy script failure.
Regards
Vishal
Hi Vishal,
Unchecking the "Abort test if an error occurs" option should be enough.
How does your first Groovy script set the failed status? The proper way to fail a script is to use an assert or throw an exception, e.g.:
assert somevalue == "expected value" // or if (somevalue != "expected value") { throw new Exception("Result is not as expected!") }
But if your Groovy script uses testRunner.fail:
testRunner.fail("Result is not as expected!")
then this line stops the entire test. The "Abort test if an error occurs" option is ignored in this case.