Retry failed test case immediately

Hi! Is it possible to retry failed test case within test suite immediately after fail? I know there are -retry=1 -retryFailedTestCases=true parameters, but failed tests are retried after complete execution of current test suite, not immediately.

I'd like to achieve following:

I have tests 1 2 and 3.
If 2 fails, test exec order is 1 2 3 2. But I need 1 2 2 3. Is it possible?

Thank you!

Comments

  • Good point, this is useful workaround which can solve my issues. Thank you Vinh.
  • Hi Vinh,

    yes I know it's not usual behavior. But I'd like to prevent some random errors during test execution.

    Example: I have add, modify and delete test. Modify and delete are dependent on add test (they share same object). Add test fails because of some non-functional error (server can be slow and some timeout in test expires) and then all other tests fail (because object was not created).

    I don't want to apply this retry model everywhere, but we have few critical tests, which are worth to be retried immediately. If there is no possibility to do it, I'd add verify/waitfor methods before each step, but it's not ideal solution.
Sign In or Register to comment.