Can we call Project level Tear down script from groovy test step?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2018
05:24 AM
10-30-2018
05:24 AM
Can we call Project level Tear down script from groovy test step?
Is there a way to call project level tear down script from any groovy script test step?
If yes, then can please some one show how to achieve it
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2018
07:07 AM
10-30-2018
07:07 AM
It is theoretically possible, but I have not figured out specifically how to make it work yet. You can use the following code:
context.testCase.testSuite.project.runAfterRunScript();
Which will not work, but that is due to the fact that it is expecting two arguments/parameters. I cannot figure out what to use for it, which are defined as:
- com.eviware.soapui.model.testsuite.ProjectRunContext
- com.eviware.soapui.model.testsuite.ProjectRunner
---
Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2018
07:11 AM
10-30-2018
07:11 AM
There might be a different way. You could retrieve the contents of the Project tear down script, and then evaluate/run that as a script.
// Get the contents of the Tear Down Script at the Project level def script = context.testCase.testSuite.project.getAfterRunScript(); // Execute the contents as a script new GroovyShell().evaluate(script)
---
Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
