1. Overview
Self-healing is an AI-driven mechanism that automatically identifies and repairs broken or obsolete locators in test cases, making the automation testing process more resilient and efficient. Locators are identifiers such as IDs, class names, XPath, or CSS selectors used to find elements on a webpage, like buttons or forms. When UI changes occur, like updates or redesigns, locators can break, leading to test failures. Self-healing adapts to these changes, reducing the manual effort to update locators and lowering test execution time.
When implementing self-healing locators, it is crucial to establish effective locator strategies and priorities. These strategies help the self-healing mechanism prioritize the use of stable and unique locators. In Zoho QEngine, elements and their locators are stored centrally, and their priority can be influenced by the order in which they are set. During test execution, if a locator fails, the self-healing feature suggests alternate saved locators for that element, which helps maintain test continuity and reduce flaky or unstable tests. After each test run, any locator adjustments made by the self-healing mechanism are available in self-healing logs for review.
2. Enabling Self-healing Mechanism
To enable self-healing mechanism, follow the steps below:
Navigate to Settings > Preferences.
Toggle on Self-Healing.

Once enabled, the elements referenced in the test cases will automatically self-heal if obsolete locators are detected.
3.1 Self-healing Logs
In the live preview, the broken locators will be self-healed with a proposed locator in the logs, represented in green. To complete the self-healing process, you need to confirm the proposed locators. The preview contains Self-Healing logs apart from the Logs and Console Log.

3.2. Steps for Self-Heal Approval
The self-healing logs will contain a list of proposed locators. By default, these locators will be in the Pending status.
To approve the proposed locators:
Select the locators you wish to approve and click Approve.
Here, you will be prompted with the list of selected proposed locators to confirm your approval. To continue with the approval, click Proceed.

Upon confirmation, the proposed locator is prioritized for that element. The updated order takes effect from the next execution and is reflected on the Elements page, where locators are stored. Until the request is approved, the proposed changes remain in a pending state unless further modifications are made to the element's locators. Alternatively, you can click the Approve icon {
} corresponding to each proposed locator to approve individual locators.
Note: Using the filter option, you can see the list of locators: All, Approved, and Pending.
