If you are familiar with automation testing, you know the importance of an initial setup/ initialization option in any automation framework. soapUI also provides the feature of executing an initial setup and tear down script for web services testing.
- Initial Setup Script : soapUI initial setup is just a place holder/ an editor for writing your initial script before start your testing. This setup is available in two levels, TestSuite level and testCase level. The groovy script written in the TestSuite option will be the first one to trigger just before the execution of that testSuite. Same for testCase, the setup script written in the testCase level will be the first to trigger just before the execution of that particular test case. The main purpose of the Initial Setup section in soapUI is to provide the user the initial property creation, initialization, etc even before the test case execution.
- TearDown Script : This is same as soapUI initial setup, the only difference is the code/ script written in this section will trigger only after the completion of testCase / testSuite depending upon where the script is written. The main purpose of this is to cleanup the automation suite like delete unwanted file, kill common objects , custom reporting etc.
log, runner, context and testSuite variables are available in both setup and teardown scripts.
Its simply super which is very understandable and very useful.Thank you !!
Thanks for your comments Sushma..
Extremely useful article. Please keep it up. Sincere Thanks.
Thank you Gurjit..
Hi Sudeesh,
Thanks for all your posts.
I have a query.
Is it possible to update the scripts inside the setup/teardown section using a groovy script?
For example:
I have a teardown script that needs to be run at the end of each test case. To copy this script into each test case, can I use a groovy script?
Currently I am manually copying the script into a new test case every time I add a test case. If I have a groovy to do this, I was wondering if I can run that groovy step alone?
Any inputs related to this will be helpful.
Thanks
Eswar
Your tutorials are very good. Nice and straight forward. Your efforts are much appreciated.