Forum Discussion

krogold's avatar
krogold
Regular Contributor
5 years ago
Solved

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...
  • avidCoder's avatar
    5 years ago

    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()