0

When a test fails and then passes after retry using IRetryAnalyzer implementation, all dependent tests are skipped.

I tried removing failed and skipped tests results as noted below but it still doesn't seem to work.

@Override
public boolean retry(ITestResult result) {
    int retryLimit = 4;
    if(counter < retryLimit)
    {
        result.getTestContext().getFailedTests().removeResult(result);
        result.getTestContext().getSkippedTests().removeResult(result);
        counter++;
        return true;
    }
    return false;
}

Any help or insight would be much appreciated. Thanks!

TestNG Version

latest (6.14.3)

Expected behavior

a() failed //i==0
a() passed //i==1
b() passed //i==2

Actual behavior

a() failed //i==0
a() passed //i==1
b() skipped // ***this is the problem***
Steven
  • 1
  • Possible duplicate of [Retrying a complete testNG class and not just @Test method on skip/failure](https://stackoverflow.com/questions/45667984/retrying-a-complete-testng-class-and-not-just-test-method-on-skip-failure) – Harish Mar 01 '18 at 18:37
  • That was it! Thanks! – Steven Mar 05 '18 at 16:42

0 Answers0