Forum Discussion

Kulbeans's avatar
Kulbeans
New Contributor
12 years ago

Always run TestStep

Hi everyone,

I'm new to SoapUI and I've been using it to test my REST API. In my TestCases I have a step that needs to be run at the beginning and another at the end, even when there's one step failing in between. I can't check to keep running on fail because I don't want it to run the other steps, but I need the last one to run or else the other tests will always fail.

Is there anyway that I can, in the setup script, handle a fail event so that, when it happens, I run the last step? I can't find information about that.

Thank you

2 Replies

  • SiKing's avatar
    SiKing
    Community Hero
    You can use the TearDown Script function. Use something like this:
    testCase.getTestStepByName(<step_name>).run(testRunner, context)
  • Kulbeans's avatar
    Kulbeans
    New Contributor
    SiKing wrote:
    You can use the TearDown Script function. Use something like this:
    testCase.getTestStepByName(<step_name>).run(testRunner, context)


    I forgot to mention that this was meant to be done in the LoadTest environment, so I don't have access to testCase.