I am having some selenium TestNG tests written in Java, which are dependable on a first initial test, that registers a user into the tested platform and passes a tutorial, all other tests are using the login credentials from that initial test.
So far so good, I am also using a retry logic (IRetryAnalyzer): https://www.swtestacademy.com/retry-failed-tests-testng-iretryanalyzer/ to retry my failed tests up to 4-5 times, because the host server sometimes yields errors at random points, which can not be fixed atm.
If the initial (register) test fails the first 2 times, and passes on it's third execution, all further tests, which are dependable on it will fail with an exception:
"java.lang.Throwable: depends on not successfully finished methods in group..."
So the test results will look like this:
Test A (Register) - failed. Test A (Register) - failed. Test A (Register) - passed. Test B (Dependable on A)- failed. Test C (Dependable on A) - failed.
Tests B and C are failing, because Test A initially failed the first time, so it's somehow recorded as a fail. The question is - can the dependable tests be made in a way, that they only depend on the passed instance of Test A, or at least try to execute them despite of the fact, that Test A failed a couple of times.
Note that using a priority parameter is not an option to consider in this scenario. Thanks.