Katalon Analytics (beta) – Bringing new insights into test reports. Learn more!

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

  • Hi there,

    Failed test cases are re-run after test suite execution is ended. If it's retried immediately after failed without waiting for test suite execution to end, it will likely break the usual testing flow.

    I think re-run failed test case after test suite execution is ended is the same with your ideal. Why would you want to re-run like that?
  • 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.
  • Unfortunately, it's not provided in Katalon Studio.

    However, there is an alternate way to do this by using Test Suite Collection. You know that Test Suite has the ability to re-run, right? How about adding your pre-condition test cases in a single Test Suite called 'TS_Pre-conditions' and add in all of your 'add' test cases into it. If any of them is failed, then it will be retried for only those 'add' test cases for that specific test suite

    Other test cases will be added in other test suites and will be executed after that'TS_Pre-Conditions' is executed successfully.

    http://prnt.sc/eq7t58

    This is just another way to resolve your issues. You can organize it better based on your test scenarios. Hope it help you resolve this case
  • Good point, this is useful workaround which can solve my issues. Thank you Vinh.
  • Interesting, Thanks for sharing your views..

    Software Testing 
Sign In or Register to comment.