Forum Discussion

mermet's avatar
mermet
Occasional Contributor
17 years ago

Groovy script executed up to the end after a testRunner.gotoStepByName(someStep)

Hi, I'm observing that a Groovy script is executed up to the end even after a testRunner.gotoStepByName(someStep);

If there an efficient way to return from a Groovy script after a testRunner.gotoStepByName() call ?  return ?


Or the only way is if() else ?

Thanks and merry Christmas !


if ( requestId.equals(contextRequestId) == false ) {
log.info ("ERROR: received RequestId value '" + requestId + "' does NOT match RequestId value in Context '" +  contextRequestId + "'");
// Protect the Test Case against out dated or unrelated Notifications
//testRunner.fail("Blabla");
log.info ("Ignoring Notification for RequestId '" + requestId + "'. Returning to step Notification Request...");
// Transfers execution of this TestRunner to the TestStep with the specified name in the TestCase
testRunner.gotoStepByName("Notification Request");

}

This code is always executed:
log.info ("Received RequestId value '" + requestId + "' matching RequestId value in Context '" + 
contextRequestId + "'");

1 Reply

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    you should be able to just do a return to exit the script.

    Hope this helps...

    regards,

    /Ole
    eviware.com