Skip to main content

AI Auto-Heal for Web Test Cases

The AI Auto-Heal feature in DevAssure is designed to improve test stability by dynamically recovering from broken locators when application UI changes occur. Instead of failing tests when an element cannot be located, DevAssure applies a combination of locator fallback strategies and AI-driven remediation to automatically repair broken steps.

This reduces flaky tests, minimizes manual locator maintenance, and ensures faster, more reliable test executions.


Auto-Heal

In traditional automation, when a UI element changes (e.g., updated IDs, CSS classes, or DOM restructuring), recorded locators fail, causing test failures.
DevAssure Auto-heal eliminates this fragility by:

  • Detecting when primary locators fail.
  • Attempting backup locators if defined.
  • Using AI-assisted context modeling to generate a new working locator.
  • Allowing teams to persist the fixed locator for future runs.

Enabling Auto-Heal

  1. Open Project Preferences from the left-side navigation.
  2. Select Web App Settings.
  3. Enable the Auto-heal toggle.

When enabled, all test recording and execution for this project will attempt auto-healing if a locator mismatch occurs.

Icon

How Auto-Heal Works

During Test Execution

  • DevAssure first attempts to locate the element using the primary locator defined in the test step.
  • If the primary locator fails, it automatically switches to the backup locators (CSS, XPath, attributes).
  • If both fail, AI Auto-Heal kicks in:
    • Dynamically generates a new working locator using contextual and visual analysis.
    • Test execution continues seamlessly without interruption.
  • This hybrid recovery strategy (backup locators + AI remediation) significantly reduces flakiness and improves test stability.

Post Execution

  • DevAssure generates a detailed auto-heal report, listing all elements that were healed.
  • Users can:
    • Fix All – replace original locators with the healed ones automatically.
    • Fix / Ignore selectively – apply changes only where needed.
info

Note: In order for a test case to be auto-healed, it must have been recorded with Auto-Heal enabled.


Example: Auto-Heal in Action

Test Case Recording

After enabling the auto-heal, a checkout flow test case was recorded with defined element locators, covering steps such as navigating to the product page, adding items to the cart, entering details, and proceeding to place an order.


Execution with Auto-Heal

During execution, the PLACE_ORDER button’s main locator failed due to UI changes.

  • DevAssure attempted the backup locators (CSS, XPath).
  • When both failed, AI Auto-Heal dynamically generated a new working locator.

As a result, the test continued seamlessly and successfully completed the checkout flow without interruption.

⚠️ Notice the alert: “Auto-healed locator used for 1 element”.

Icon

Auto-Healed Elements Report

Auto-healed elements are displayed with their main locator, working locator, and backup locators.
You can click Fix to update the locator permanently.

ELEMENTWORKING LOCATORSBACKUP LOCATORSACTIONS
web > Cart > PLACE_ORDERCSS :: .active[alt='Twirlex Diamond Pe…']✅ Fix / ❌ Ignore

You can Fix All to replace all failing locators at once or handle them individually.

Icon