Forum Discussion
- RadfordSuper Contributor
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) } } }
- niravk17Occasional Contributor
- RadfordSuper 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?