Forum Discussion
omatzura
17 years agoSuper Contributor
Hi Ali,
this sounds interesting, is there public documentation for the open API available? Integrating with Mercuri would be a great value-addon for many of our users..
Regarding your questions:
1) Use
testRunner.testCase.name
to get the name of the testcase (it's in the ModelItem interface)
2) Hmm.. the problem is that the testcase has not finished yet (if you're in a groovy script).. what you could do is loop through all the TestStepResults for the running TestCase and check if any of them have failed;
// get list of results
def results = testRunner.results
log.info( "Checking " + results.size() + " TestStepResults.." )
def c = 0;
while( c < results.size() )
{
if( results[c].status.toString() == "FAILED" )
break;
c++
}
// failed?
if( c < results.size() )
{
log.info( "Failure in TestStep [" + results[c].testStep.name + "]" )
for( msg in results[c].messages )
log.info( msg )
}
else
{
log.info( "All is well" )
}
Hope this helps!
regards,
/Ole
eviware.com
this sounds interesting, is there public documentation for the open API available? Integrating with Mercuri would be a great value-addon for many of our users..
Regarding your questions:
1) Use
testRunner.testCase.name
to get the name of the testcase (it's in the ModelItem interface)
2) Hmm.. the problem is that the testcase has not finished yet (if you're in a groovy script).. what you could do is loop through all the TestStepResults for the running TestCase and check if any of them have failed;
// get list of results
def results = testRunner.results
log.info( "Checking " + results.size() + " TestStepResults.." )
def c = 0;
while( c < results.size() )
{
if( results[c].status.toString() == "FAILED" )
break;
c++
}
// failed?
if( c < results.size() )
{
log.info( "Failure in TestStep [" + results[c].testStep.name + "]" )
for( msg in results[c].messages )
log.info( msg )
}
else
{
log.info( "All is well" )
}
Hope this helps!
regards,
/Ole
eviware.com
Related Content
- 2 months agoStoplight
- 3 years agoaaronpliu
- 2 months agoStoplight
- 3 years agogeneticmaterial
- 12 years agolphilippe_macau