Skip to main content

Auto-Heal for Automation Scripts in KaneAI with HyperExecute

What is Auto-Heal in KaneAI & HyperExecute?

KaneAI, the GenAI Native testing assistant from LambdaTest, generates automation test scripts across multiple languages and frameworks using natural language instructions. When these scripts are executed via HyperExecute, LambdaTest’s high-performance test orchestration platform, they come with an added layer of reliability—the Auto-Heal feature.

Auto-Heal ensures your automation scripts remain robust, even when the application under test undergoes changes like modified element locators (IDs, XPaths, CSS selectors). Instead of failing the test immediately when locators break, KaneAI dynamically finds new locators at runtime by leveraging the original natural language instruction used to execute the test case.

How is Auto-Heal Implemented?

Multi-Locator Fallback Approach

  • Every element identified by KaneAI comes with multiple locators (XPath, CSS, ID, etc.) at the time of script generation.
  • During execution on HyperExecute, if the primary locator fails, the script automatically tries fallback locators sequentially.

Locator Healing via Natural Language Understanding

  • If all locators fail, KaneAI doesn't stop there.
  • It re-evaluates the original natural language instruction that generated the test step.
  • Using AI models trained on automation scenarios and web element patterns, KaneAI rebuilds the locator on-the-fly based on the intent of the instruction (e.g., “Click on the ‘Submit’ button”).
  • The test step continues without manual intervention, ensuring minimal test flakiness and faster issue resolution.

Complexity of Auto-Heal Logic

The core logic of Auto-Heal integrates several sophisticated systems working in real-time:

  1. Locator Redundancy and Priority Mapping:

    • Prioritized fallback locators based on confidence scores.
  2. Natural Language Parsing with Context Awareness:

    • Re-parsing instructions with contextual understanding of nearby elements, page structure, and DOM hierarchy.
  3. Visual Query Integration (where applicable):

    • When locators cannot be determined purely through DOM, KaneAI utilizes visual queries to identify elements based on their appearance and relative positioning.
  4. Scope of Auto-Heal:

    • Any command that requires the use of an element locator, such as Click, Type, or Hover, falls under the purview of auto-heal.

Benefits of Auto-Heal

  • Reduced Test Maintenance Effort:
    No need to manually update locators when the application UI changes.

  • Increased Automation Stability:
    Avoid flaky tests caused by minor DOM updates or attribute changes.

  • 🧠 AI-Native Healing with Context:
    Uses the original intent behind instructions to intelligently recover from failures.

  • ⏱️ Faster Execution with HyperExecute:
    Combined with the speed of HyperExecute, the healing process occurs in real-time without significant delays.

  • 📉 Lower Failure Rate in CI/CD Pipelines:
    Ensures test cases remain green more consistently, even with frequent app changes.

Future Additions to Auto-Heal (In roadmap)

  • 🧭 Detailed Healing Reports:
    Automatic reporting of healed locators, fallback paths taken, and suggestions for locator improvements.

  • 📌 Auto-Update Healed Locators:
    Automatically update auto-healed locators in a new version of the test case script generated by KaneAI, further reducing maintenance overhead.

Video Explanation

🎥 Watch the Demo: How Auto-Heal Works in KaneAI with HyperExecute

The video walkthrough explains:

  • How KaneAI generates scripts with fallback locators.
  • Demo of locator failure and Auto-Heal in action.
  • How KaneAI dynamically finds new locators using the original instruction.

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles