Ask a Question

testRunner.cancel does not cancel calling testCase

SOLVED
krogold
Regular Contributor

testRunner.cancel does not cancel calling testCase

Hello,

I want to cancel a testCase so in a groovy script I call

testRunner.cancel(mymsg)
return null

The problem is that this testCase is called by another one and I'd like to cancel the caller if the callee is canceled.

Is there any straightforward way to do that ?

 

thank you

1 ACCEPTED SOLUTION

Accepted Solutions
avidCoder
Super Contributor

Re: testRunner.cancel does not cancel calling testCase

If you have groovy testStep then try below code :-

def testStep =  context.getProperty( "#TestSuiteDetails#" )
if( testStep != null ) {
    testStep.cancel( "Your message" )
}

And in script assertion, try this :-

context.testRunner.cancel()

View solution in original post

2 REPLIES 2
avidCoder
Super Contributor

Re: testRunner.cancel does not cancel calling testCase

If you have groovy testStep then try below code :-

def testStep =  context.getProperty( "#TestSuiteDetails#" )
if( testStep != null ) {
    testStep.cancel( "Your message" )
}

And in script assertion, try this :-

context.testRunner.cancel()

View solution in original post

sonya_m
Community Manager

Re: testRunner.cancel does not cancel calling testCase

Thank you so much avidCoder! 

 

Hi @krogold, did you try implementing the suggestions? Was it a success? 


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: