Forum Discussion

ToddBfute's avatar
ToddBfute
Occasional Contributor
13 years ago

Running a single script after each testcase

Howdy,

A million years ago I worked for a company with a very advanced test tool set (advanced for a million years ago :-). One of the things that this tool allowed us to do was to define a testcase teardown script at the suite level (meaning only one definition even though there might be dozens of tests) which ran after each testcase.

From what I see in soapUI I can define a suite teardown that runs at the end of the suite, or I can define a testcase teardown (which must be defined on each testcase individually).

I had hoped that I could use the suite teardown with some logic to figure out which test ran, but the way it looks that only runs if I run the whole test suite. In other words if I jump into a particular testcase and run it, it won't run the suite teardown.

Help! I'm trying to avoid having to maintain the same teardown script in dozens of testcases.

Thanks
-TAB

1 Reply

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

    wow.. time flies..

    You could create an Event Handler for the TestRunListener.afterRun event, this would be called after any TestCase in your Project is executed (the handler could check which TestSuite it is in if you want to limit it), read more about event handlers at http://soapui.org/Scripting-Properties/ ... dlers.html

    Hope this helps,

    regards,

    /Ole
    SmartBear Software