Forum Discussion
1 Reply
- Sam19New Contributor
I have Achieved it by following code where failed test cases run in Serial
def reRunCount = Integer.parseInt(testSuite.getPropertyValue("RerunCount"))
log.info reRunCount
for ( testCaseResult in runner.results )
{
testCaseName = testCaseResult.getTestCase().name
log.info testCaseName
if ( testCaseResult.getStatus().toString() == 'FAILED' )
{
log.info "$testCaseName has failed"
for (i = 0; i < reRunCount; i++)
{
def tRun = testCaseResult.testCase.run(null, false)
log.info tRun.getStatus()
if(tRun.getStatus().toString() == "FINISHED")
{
break;
}
if(tRun.getStatus().toString() == "FAILED" && i == 0)
{
for( testStepResult in tRun.results )
{
if(testStepResult.getStatus().toString() != "OK")
{
log.info "TestStep [" + testStepResult.testStep.name + "] finished with status " + testStepResult.getStatus().toString()
testStepResult.messages.each() { msg -> log.info msg }
}
}
}
}
}}
But I want to run the failed test case in parallel
Any help??