Forum Discussion
6 Replies
- omatzuraSuper ContributorHi Ali!
If you want to stop it use
testRunner.cancel( "I'm getting tired" )
if you want to fail it use
testRunner.fail( "It didn't work" )
(the string is a reason displayed in the log)
regards!
/Ole
eviware.com - Hi!
just call return, ie
if( ... )
{
testrunner.cancel( "time to go home" )
return null
}
Does that help?
regards,
/ole
eviware.com - Beno_IskratelFrequent Contributorhi,
let say that i have groovy with 200 lines.
if i use testRunner.cancel( "I'm getting tired" ) at line 50, the rest of 150 lines will still execute.
what shall i use to stop test case and also stop groovy from further execution?
stoping groovy at certain position is in fact eveyrthing what i need.
"assert false" will do the job, but it's not the best solution.
regards,
beno - Beno_IskratelFrequent Contributorhi ole,
yes, you answer did help me. tnx.
i have another question.
for example, i have 20 different assertions in my test step.
on place 5 is script assertion.
can i make this script assertion stop executing the rest of assertions?
in case that i get response: "Request is not supported in this product.", i would just like to close this test step with pass/true and prevent all other assertions to mark him red/failed.
can this be done?
regards,
beno - Hi beno,
sorry, this isn't currently possible but it does make good sense so I'll add it to the backlog for consideration!
regards,
/Ole
eviware.com - Beno_IskratelFrequent Contributorhi,
any updates about this?
is it possible to cancel the rest of assertions that are after some script assertion?
with best regards,
beno