Option to rerun failed test automatically

We should have an option to re-run a failed test case and final report should go only after the retry. If there is an option to select number of retries it would be even better.

~ On behalf of Kiran

Let me rephrase to make sure I understood what you mean by rerun feature:

  • You want to be able to set automatic retries for up to N times if a test fails.

Is this correct?

Also, is there a specific kind of failure that you’d typically want to retry for?

e.g.

  1. Network failures, e.g. 404 or 503 errors
  2. Third-party integration failures, e.g. Payment gateway failures
  3. Others

Typically for test failures caused by network and third-party integration failures, we’d recommend implementing a retry within the test itself, e.g.:

var serviceNotAvailable = false
for(var i = 0; i < 10; i++){ // try up to 10 times
    serviceNotAvailable = I.see$("503 service not available") // if page shows 503, return value is false
    if(!serviceNotAvailable){
        break // if no error, proceed
    } else {
        I.wait(300) // if there's an error, wait for 5 minutes
        I.refreshPage() // and refresh the page
    }
}