Forum Discussion

robjahn's avatar
robjahn
Contributor
12 years ago

go to a test case in another suite

Is it possible to go to a test case step in another suite?

gotoStepByName - seem to only only a goto within the current test case.

for example, I want to....

Suite 1
Test Case 1
Test Step 1
Test Step 2 <-- if this is a groovy step....direct the processing to goto Suite 2, test 4, step 1
Test Step 3
Test Case 2
Test Step 1
Test Step 2

Suite 2
Test Case 3
Test Step 1
Test Step 2
Test Step 3
Test Case 4
Test Step 1
Test Step 2

5 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    No, there is no standard way to achive this.
    However, you could make it work, by calling the other TestSuite using a Groovy Script TestStep as you seams to be refering to.

    ---
    Regards

    Erik, SmartBear Support
  • Please direct me to another post, but I could not find a definitive answer in my forum searches.....but is there a way to "abort" the running of the test suite in groovy? references I found where to cancel and fail functions with test runner, but those seem to just exit the current step and write a message to soapUI log and not "abort" all execution. i.e context.testRunner.cancel('Failed in Final Validate");

    using similar example, I want to do this..........

    test suite 1
    test case 1
    test case 2 <--- find a error condition here, stop all processing and do not continue to test suite 2.
    test case 3
    test suite 2
    test case 4
    test case 5
    test case 6
  • Also if not too much trouble.......Can you provide code snippet example of how to "However, you could make it work, by calling the other TestSuite using a Groovy Script TestStep as you seams to be referring to?"

    I only found functions to goto step within a current test step, not the method to goto a new test case within a different test suite.
  • RJanecek's avatar
    RJanecek
    Regular Contributor
    answer for your second question:

    add this to every testCase tearDown Script:

    you are iterating over all testStep and if one is failed = testCase is failed so you cancel projectRunner

    for ( testStepResult in testRunner.results ) {
    if (testStepResult.getStatus().toString().equals("FAILED")){
    def tsr = context.getProperty( "#ProjectRunner#" )
    if( tsr != null ) tsr.cancel( "The assertion failed" )
    }
    }
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    Are you still having problems with this?

    --
    Regards

    Erik
    SmartBear Sweden