Forum Discussion
The following is a Test Case teardown script that iterates through all the test steps might help out:
for(result in testRunner.getResults()){ if(result.getStatus().toString() != 'OK' ){ def failedTestStepName = result.getTestStep().getName() log.error('TestStep "' + failedTestStepName + '" finished with the status ' + result.getStatus().toString()) for(testProperty in testCase.getTestStepByName(failedTestStepName).getPropertyList()){ log.info(testProperty.getName() + ' = ' + testProperty.getValue()) } for(message in result.getMessages()){ log.error('Error message: ' + message) } } }
Thank you Radford .
While execution of test case one of my assertion step get fail but still process of execution is 'Finished " and its printing finished status not failed
If you opt out Abort on failed test cases its still log as "finished" instead of failed
Please find the attchment
- Radford8 years agoSuper Contributor
Sorry, I'm not sure I understand you when you say "its printing finished status not failed", the TestStepResult method getStatus() returns an TestStepResult.TestStepStatus enumeration:
http://www.soapui.org/apidocs/com/eviware/soapui/model/testsuite/TestStepResult.html
This can only be one of four things:
- CANCELED
- FAILED
- OK
- UNKNOWN
I have not experimented with the "Abort on Error" option, perhaps "Fail TestCase on Error" is also worth investigating?
- nmrao8 years agoChampion Level 3I believe that you do not have to check each and every step to see if the test is passed or not, if I got your issue right.
Please see(Message 11 of 14) if the script provided in this thread is helpful in your case.
https://community.smartbear.com/t5/SoapUI-NG/Adding-new-test-step-for-all-test/m-p/105907/highlight/true#M24605