Retrying Failed Tests

In this topic, we will see how to trigger the failed tests.

Manually re-running failed tests

At the end of the test suite run, by default, testng-failed.xml is created in the output directory containing only the failed tests. We can run this test suite to rerun only the failed tests.

Programmatically re-running failed tests

To programmatically trigger the failed tests right after the tests fail, we can use IRetryAnalyzer. Implementation of the SampleRetryAnalyzer needs to be added to test methods to ...