Forum Discussion

roryLIT's avatar
roryLIT
Contributor
11 years ago

Using groovy to check pass/fail status of steps in testcase

Hi,

I'm running a testcase and have a groovyscript step at the end of the test. In the groovyscript step I want to check that the test passed ok and no steps failed. How would I write this? If all steps passed I would write a result of PASSED to a testcase level property and if a step failed I would do the same only with a result of FAILED

Thanks for help!

1 Reply

  • SiKing's avatar
    SiKing
    Community Expert
    Why? SoapUI does this for you.

    You could create a TearDown Script with something like
    testCase.setPropertyValue("testStatus", testRunner.status.toString())


    If you really insist doing it in the test step, you would have to iterate over the steps, get each of their status, and then decide what you want to do from there. Hints for this are here: http://www.soapui.org/Scripting-Propert ... into-files