[Solved] How to get test case result via Groovy
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2012
08:37 AM
03-13-2012
08:37 AM
[Solved] How to get test case result via Groovy
Hello,
How can I get the result of a test case using Groovy, i.e. just a simple "PASSED" or "FAILED"? I've found this link (http://www.soapui.org/Scripting-Propert ... ng-results) but it logs all test step results.
Sincerely,
Robert
How can I get the result of a test case using Groovy, i.e. just a simple "PASSED" or "FAILED"? I've found this link (http://www.soapui.org/Scripting-Propert ... ng-results) but it logs all test step results.
Sincerely,
Robert
4 REPLIES 4
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2012
03:54 AM
03-14-2012
03:54 AM
I've found the following code line which gives me the status of the test case.
However the following does not work:
Nothing is written to the script log.
def result = testRunner.getStatus()
However the following does not work:
def result = testRunner.getStatus()
if (result == "FINISHED") {
log.info("Test passed")
} else {
log.info("Test not passed")
}
Nothing is written to the script log.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2012
04:06 AM
03-14-2012
04:06 AM
Found the solution:
or
def result = testRunner.getStatus()
if (result == com.eviware.soapui.model.testsuite.TestRunner.Status.valueOf("FINISHED")) {
log.info("Test passed")
} else {
log.info("Test not passed")
}
or
def result = testRunner.getStatus().toString()
if (result == "FINISHED") {
log.info("Test passed")
} else {
log.info("Test not passed")
}
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2019
03:34 AM
08-20-2019
03:34 AM
I am sorry, but this gives me always "RUNNING" when I try to execute test..
So there is really no way.. how to in side TC get status?
Thanks a lot.. I am lost after few hours to found solution..
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2019
03:38 AM
08-20-2019
03:38 AM
This works only in tear donw script.. but not in groovy test step.. In groovy test step you will get only "RUNNING"..
