Retry Mechanism

Modified on Thu, 27 Feb at 3:08 PM

TABLE OF CONTENTS

1. Overview

2. Enabling the Retry flag in Application Settings File

1. Overview

A retry mechanism is a method that automatically tries to re-execute the failed test cases. 

Following are some of the scenarios where you might have to re-run tests manually to make the tests succeed:

  • WebElement not being found. For more information, refer to Auto healing article.
  • Server environment is down
  • The third-party API that you are using is down.
  • The browser becomes unresponsive while tests are running.
  • An unwanted pop-up appears in the window, which is intermittent and cannot be located to handle in a test.
  • The browser on which we want to run the tests on the cloud platform is busy and couldn’t be made available to run the tests.

For example, if there are 10 test cases being executed and the second one fails due to any of the above issues or any other issues. In this case, retry mechanism is used only to rerun the second test case.

2. Set the Retry Count flag in ApplicationSettings.xml File

Perform the following:

  1. After generating the script, download it to your local folder. 

  2. Open the folder where you downloaded the script. Navigate to ApplicationSettings.xml file which is available in the Java folder.

  3. Open the ApplicationSettings.xml File. Search for the setting related to the retry count.  Change the value of <RetryFailedTestCaseCount> to the appropriate retry count. By default, retry count is set to 1.<RetryFailedTestCaseCount> indicates number of retry mechanism. to be attempted.
  4. After setting the retry count, save the changes you have made to the ApplicationSettings.xml file.
  5. Make sure you set the 
  6. Open the command prompt within the script folder.
  7. Run the following command for script execution:
    java -jar algoQAUtil.jar -javaSelenium retry








Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article