TABLE OF CONTENTS
2. Enabling the Auto healing feature in Application Settings File
1. Auto Healing Overview
The auto healing feature helps in addressing locator issues caused by changes in the application being tested (AUT). Auto healing feature is applicable to Web automation using Java Selenium framework. Make sure that necessary prerequisites (Java and Maven) are installed. To scrape the UI elements, refer to the article - algoScraper as an Extension Tool for Chrome or Edge Users and to automate Web Applications, refer to the article - How to Automate Web Applications?
When the application being tested changes, the scripts may face issues locating specific elements. If this happens, the script might fail to execute. However, with algoQA's auto healing feature enabled, it automatically identifies and fixes these issues with broken or changed elements.
For example, consider a scenario where the web application is updated with its login process. Initially, there is a "Login" button labeled with the ID "loginButton".
<button id="loginButton">Login</button>
Later, the button ID is changed to "signInButton":
<button id="signInButton">Sign In</button>
When the auto-healing feature is enabled in a test scenario, the script searches for the element with the ID "loginButton". If it fails to find it, the test will result in failure. Then the feature recognizes that despite the change in ID to "signInButton", the button's functionality remains the same. It adjusts its search criteria to locate the "signInButton", ensuring the test can proceed without any issues.
The auto healing feature uses Large Language Models (LLMs) along with the Document Object Model (DOM) of the web page to suggest locators when the original locator becomes invalid.
How it works:
- This feature will be triggered after all the test cases are executed in a test run. Once the test cases are auto healed, they are re-executed in the same test run.
- The retry mechanism can be used only to rerun the failed test case in the previous test run.
For example, if there are 10 test cases being executed and the second one fails due to a locator issue, auto healing will be triggered only after the 10th test case has been completed. In this case, retry mechanism is used only to rerun the second test case.
Note: Auto healing feature doesn't apply to changes in the workflow of the application. This feature is manually incorporated into our scripts.
2. Enabling the Auto healing feature in Application Settings File
Perform the following:
After generating the script, download it to your local folder. This folder must contain the script file that you have generated.
- Open the folder where you downloaded the script. For example, if your script is located at AlgoAFScript_202402121131\src\test\java, navigate to this folder. Applications.xml file will be available in the Java folder as shown:
- Open the ApplicationSettings.XML file and locate the setting related to the auto-healing feature. Set this setting to True to enable auto-healing feature.
- After setting the auto-healing feature to True, save the changes you have made to the application settings file.
- Open the command prompt within the script folder
- Run the following command for script execution along with retrying failed test case:
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
Feedback sent
We appreciate your effort and will try to fix the article