Re-Run Failed Tests

Retry executing only Failed Tests using TestNG

There may be many reasons for a Test case getting failed, may be due to element not found or time out exception or stale element exception etc. Normally in automation after executing scripts/tests, we will check for the results and if the test fails because of above reasons we will re-run then again.

Instead of that we can ask testNG to execute the failed test cases again for X (we can define) number of times and check for the updated results.