Skip to content

Instantly share code, notes, and snippets.

@ursshivy
Created February 14, 2019 11:36
RetryAnalyzerImpl.java can be used to retry any failed test. You can update maximum retry count as per requirement.
import org.testng.IRetryAnalyzer;
import org.testng.ITestResult;
public class RetryAnalyzerImpl implements IRetryAnalyzer {
private int retryCount = 0;
private static final int maxRetryCount = 1;
@Override
public boolean retry(ITestResult result) {
if (retryCount < maxRetryCount) {
retryCount++;
return true;
}
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment