def reRunCount = Integer.parseInt(testSuite.getPropertyValue("RerunCount")) for ( testCaseResult in runner.results ) { if ( testCaseResult.getStatus().toString() == 'FAIL' ){ for (i = 0; i < reRunCount; i++) { def tRun = testCaseResult.testCase.run(null, false)//need to have "true" as the second argument log.info("Run..." + testCaseResult.getTestCase().name) if(tRun.getStatus().toString() == "PASS"){ break; } } } }