Ask a Question

Running a single script after each testcase

Occasional Contributor

Running a single script after each testcase


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.

SmartBear Alumni (Retired)


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 ... dlers.html

Hope this helps,


SmartBear Software

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Showing results for 
Search instead for 
Did you mean: