Forum Discussion

mpartyka's avatar
mpartyka
Contributor
9 years ago

Is there a way in groovy to pass control to another test CASE based on a condition?

I have a successful groovy step to pass control to another Test STEP based on a condition, but I need to pass to another Test CASE (or Test SUITE).  Is this possible ?  Thanks

3 Replies

  • Radford's avatar
    Radford
    Super Contributor

    I'm not 100% sure if this is what you are after, but have you looked at the Run TestCase test step?

     

    This page has details of how the accomplish the same via Groovy.

    • mpartyka's avatar
      mpartyka
      Contributor

      Thanks for quick response ... looking it over now.   I want to pass control to the new test step (and  NOT return) so not sure this will work, but reading up on it !  Thanks!

      • Radford's avatar
        Radford
        Super Contributor

        Sorry, I've never had to pass control and not return contol. The only thing I could possibly point out is that there is a cancel method on the TestRunner object. So perhaps you can run another testcase and cancel the current one? Just an idea so not sure if this is possible.