Forum Discussion

artest's avatar
artest
New Contributor
2 years ago

Run ReadyAPI Projects in TestEngine changed build result to FAILURE even after successful rerun

I'm running my suite in testengine , I used the script: 

import com.eviware.soapui.model.testsuite.TestRunner.Status


def reRunCount = Integer.parseInt(testSuite.getPropertyValue("RerunCount"))
def failTestSuite = false
for ( testCaseResult in runner.results ) {
if ( testCaseResult.getStatus().toString() == 'FAIL' ){
def tRun
for (i = 0; i < reRunCount; i++) {
tRun = testCaseResult.testCase.run(null, false)
log.info("Run..." + testCaseResult.getTestCase().name)

if(tRun.getStatus().toString() == "PASS"){
runner.status = Status.FINISHED
break;
}
}

if(tRun.getStatus().toString() == "FAILED")
{
failTestSuite = true
}
}
}

if(failTestSuite)
{
runner.status = Status.FAILED
}

 to rerun the filed cases and  in testengine dashboard I see job status as Passed, but in Jenkins I'm getting 

Build step 'Run ReadyAPI Projects in TestEngine' changed build result to FAILURE 

 and build is failed( report was generated before rerun and was not updated with rerun results), how can I make this Run ReadyAPI Projects in TestEngine  plugin to set job to success if it Pass after rerun? thanks

  • Vallalarasu_P's avatar
    Vallalarasu_P
    Frequent Contributor

    Is it because of ReadyAPI Testcase Options - "Fail Test Case if it has failed Test Step" ?

    • artest's avatar
      artest
      New Contributor

      no, in test cases for this suite Options - "Fail Test Case if it has failed Test Step"   is disabled..., jenkins still failing even if after rerun case passed