Forum Discussion
SoapUser2012
13 years agoOccasional Contributor
Hi ,
I'm not able to do that as I'm getting the exception .Do i need to take the context of test suite or how does it recognise "runner.results" when done in Groovy?
and i also tried this in teardown script ,but not see results(logged info ) captured and shown in TestSuite log or anywhere.
for ( testCaseResult in runner.results )
{
testCaseName = testCaseResult.getTestCase().name
log.info testCaseName
if ( testCaseResult.getStatus().toString() == 'FAILED' )
{
log.info "$testCaseName has failed"
for ( testStepResult in testCaseResult.getResults() )
{
testStepResult.messages.each() { msg -> log.info msg }
}
}
}
Teardown script code should automatically get executed after all the test cases are run .Where do i see the results of this tear down ?
thanks
I'm not able to do that as I'm getting the exception .Do i need to take the context of test suite or how does it recognise "runner.results" when done in Groovy?
and i also tried this in teardown script ,but not see results(logged info ) captured and shown in TestSuite log or anywhere.
for ( testCaseResult in runner.results )
{
testCaseName = testCaseResult.getTestCase().name
log.info testCaseName
if ( testCaseResult.getStatus().toString() == 'FAILED' )
{
log.info "$testCaseName has failed"
for ( testStepResult in testCaseResult.getResults() )
{
testStepResult.messages.each() { msg -> log.info msg }
}
}
}
Teardown script code should automatically get executed after all the test cases are run .Where do i see the results of this tear down ?
thanks