Running a single script after each testcase
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2011
09:59 AM
11-16-2011
09:59 AM
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
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 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2011
12:55 PM
11-16-2011
12:55 PM
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
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
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
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
