Self-Healing Mechanism for Automated Web Testing – SoliteraTA

SoliteraTA

Self-Healing Mechanism for Automated Web Testing

Overview #

In web-based automated testing, it is common for tests to fail due to changes in the web application’s UI. Elements are identified through various selectors like XPath, CSS, or other type-value pairs. The self-healing mechanism is designed to address failures caused by such changes by automatically locating and using the selectors of the affected elements.

How Self-Healing Works #

Self-healing is triggered when a test is unable to locate an element using its predefined selectors. The mechanism then utilizes the properties and images of elements stored from the last successful test execution to identify and replace the failed selectors.

Configurable Properties #

Self-Heal Toggle

Description: Enables or disables the self-healing functionality.
Options: ON/OFF

Element Retention

Description: Determines the number of top matching elements to consider for self-healing.
Parameter: Integer value representing the number of elements to retain.

Element Heal Threshold

Description: The minimum percentage of similarity required between the original element properties and the properties of a potential match for self-healing.
Parameter: Percentage value.

Use Image Healer Toggle

Description: Enables or disables the Image-healing functionality.
Options: ON/OFF
Requirements : For user to use image healing, OpenCV 4.7.0 need to be installed as well path of the open cv added to the environment variable.

Image Heal Threshold

Description: The minimum percentage of similarity required between the original element image and the image of a potential match for self-healing.
Parameter: Percentage value.

Image Healer Weightage

Description: Defines the relative importance of property matches versus image matches in calculating the final similarity score for self-healing.
Parameter: Percentage value (0-100%), where 100% gives full weight to image matches.

Detailed Process #

  1. Element Storage: During a normal execution, if self-heal is enabled it will store the elements properties and images to be used later for self-heal.
  2. Element Identification: During self-healing, the system scans the web application for elements that closely match the stored CSS and computed properties of the original element.
  3. Element Selection: The system sorts potential matches by their similarity score and considers them in descending order up to the number specified by ‘Element Retention’.
  4. Threshold Application: An element is eligible for self-healing if it meets or exceeds both the ‘Element Heal Threshold’ and ‘Image Heal Threshold’.
  5. Weightage Application: The final similarity score is calculated using the weightage given to image healer and the remaining to the element properties and final is the combination of both.
  6. Final Selection: The system selects the element with the highest final similarity score and updates the test to use the new selector, as well keep the element stored for further execution in the same execution cycle.

User Control and Feedback #

Users can adjust the self-healing parameters to fine-tune the process. After self-healing is attempted, a detailed report is generated, providing:

– A warning status indicating that self-healing was initiated.

– A self-healing message detailing the properties and image comparison results.

– The new selectors that have replaced the failed ones.

Best Practices

– Set conservative thresholds to ensure that only high-confidence matches are considered for self-healing.

– Adjust the weightage between element properties and image matches based on the specific needs and the dynamics of the web application’s UI.

Solitera may collect certain information by automated means, such as cookies and web beacons, when a user visits our website. A “cookie” is a small piece of data that a website can send to your browser, which may then be stored on your system. learn more

Choose your Operating System