Disable Healing
Section-Specific Healing Disabling

To temporarily disable the healing mechanism for certain sections of your code, use the following syntax.
This approach involves temporarily disabling the healing mechanism for specific sections of code across various parts of an application. It is applicable to all programming languages and also supports Appium, thereby making it versatile for a range of development and testing environments.
JavascriptExecutor js = (JavascriptExecutor) driver; 
js.executeScript("disable_healing_true");  // Begin no-healing section
... // Your code that does not require healing
js.executeScript("disable_healing_false"); // End no-healing section
This approach allows you to control the use of the healing mechanism by enabling it only where it is truly needed. This can be beneficial for scenarios where it is crucial to ensure the precise execution of code without automatic corrections, such as in testing new functionalities or specific edge cases.

Usage Guidelines:
  1. Identify Sections: Before implementing disable healing, identify the sections of your code where healing is to be temporarily turned off. This might typically include critical code blocks where the original behavior is necessary for accurate testing or where healing might introduce unintended side-effects.
  2. Implementing Disable Healing: Wrap the identified sections of code as demonstrated above, using disable_healing_true to start the no-healing phase and disable_healing_false to end it.
  3. Test: After implementing, thoroughly test both the sections with disabled healing and those without to ensure that the application behaves as expected in both scenarios.
By following these guidelines, developers and testers can maximize the effectiveness of both the healing and non-healing sections of their application, ensuring functionality and stability across various use cases.

Element-Specific Healing Disabling

By default, Healenium performs healing on all findElement methods executed during the testing session. However, healing is not performed when using findElements methods. If you want to enable healing for findElements, you can do so by toggling the relevant selector on the Healenium selectors page.

To disable/enable healing for a specific selector, you can navigate to the Healenium selectors page at http://<hlm-backend>/healenium/selectors (locally: http://localhost:7878/healenium/selectors/) and locate the relevant selector. Then, you can toggle the selector to disable healing for it.

Here are the steps to disable/enable healing for a selector:

  1. Navigate to http://<hlm-backend>/healenium/selectors in your web browser.
  2. Locate the selector that you want to disable healing for.
  3. Toggle the selector to disable/enable healing for it.

After you disable/enable healing for a selector, Healenium will not perform/performs healing for the findElement/findElements methods that use that selector during the testing session.

Note that this feature only applies to findElement and findElements methods. If you want to disable healing for an entire test case, you can use the heal-enabled=false (healenium.properties) for hlm-web and HEAL_ENABLED (env variable) for hlm-proxy property.
The Healenium Selectors consists of several sections, including:

  • Locator
  • The class in which it is used (hlm-web only)
  • The method (hlm-web only)
  • Type. Single = findElement. Multiple = findElements
  • URL of page
  • Healing Enable toggle

By default, the locator is not associated with the page on which it was found. If you have identical locators on different pages, set KEY_SELECTOR_URL=true and then the selector will be associated with the page on which it was found. In the database, two locators will be saved, but they will be used on different pages.

About Healenium
Contacts
  • Anna_Chernyshova@epam.com - Project Manager
  • Dmitriy_Gumeniuk@epam.com - Project Supervisor