Auto-Healing Support for Custom action Xpaths in Web Automation Framework

Modified on Tue, 7 Oct at 4:30 PM

TABLE OF CONTENTS

1.Overview

2.What Has Changed

3.Action Required by Developers
Example Update

Output Storage
4.Advantages

1.Overview

Now auto-healing functionality includes for custom actions to improve script robustness and reduce maintenance caused by locator changes. To enable this enhancement, a key architectural update has been made regarding how element locators and HTML targets are captured.

2.What Has Changed

  • Centralized Locator Capture:
    The call to CommonUtil.storeElementInJson(output, elementHtml); has been removed from individual workflow methods and custom function calls.

  • New Central Method:
    Element locator and HTML target capture is now centralized in the getYMLObjectRepositoryData() method. This ensures a consistent and unified tracking mechanism, which is essential for enabling the new auto-healing feature.

3.Action Required by Developers

To support this upgrade, developers must update their custom method definitions to include an additional identification parameter. This parameter should be passed to the getYMLObjectRepositoryData() method to allow:

  • Proper locator and element HTML tracking

  • Correct inclusion of locator metadata in htmlElement.json

  • Continued functionality of the auto-healing mechanism for custom code paths

Example Update

Before:

public void customClickMethod(WebElement element) { // old way }

After:

public void customClickMethod(String elementIdentifier, WebElement element) { getYMLObjectRepositoryData(elementIdentifier); // New centralized call }

Output Storage

Captured locator and element data are stored in the htmlElement.json file, enabling runtime fallback and healing if a locator fails.

4.Advantages

  • Reduces script breakages due to DOM changes

  • Improves maintainability for large test suites

  • Provides consistent locator tracking across standard and custom methods

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