Interview Questions

Logging the result messages of all TestSteps in all failing TestCases

SoapUI FAQ


(Continued from previous question...)

Logging the result messages of all TestSteps in all failing TestCases

This is intended to run in a TestSuite Teardown Script.
01.for ( testCaseResult in runner.results )
02.{
03. testCaseName = testCaseResult.getTestCase().name
04. log.info testCaseName
05. if ( testCaseResult.getStatus().toString() == 'FAILED' )
06. {
07. log.info "$testCaseName has failed"
08. for ( testStepResult in testCaseResult.getResults() )
09. {
10. testStepResult.messages.each() { msg -> log.info msg }
11. }
12. }
13.}

(Continued on next question...)

Other Interview Questions