Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions docs/kaneai-auto-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
id: kaneai-auto-heal
title: Auto-Heal for Automation Scripts in KaneAI with HyperExecute
hide_title: false
sidebar_label: Auto-Healing
description: This documentation will help you to understand how auto-healing works on KaneAI
keywords:
- auto-heal
- locators
- kane ai
url: https://www.lambdatest.com/support/docs/kaneai-auto-heal/
site_name: LambdaTest
slug: kaneai-auto-heal/
---

<script type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify({
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://www.lambdatest.com"
},{
"@type": "ListItem",
"position": 2,
"name": "Support",
"item": "https://www.lambdatest.com/support/docs/"
},{
"@type": "ListItem",
"position": 3,
"name": "Auto-Healing",
"item": "https://www.lambdatest.com/support/docs/kaneai-auto-heal/"
}]
})
}}
></script>

## What is Auto-Heal in KaneAI & HyperExecute?

KaneAI, the AI-powered automation engine 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 execution 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-Powered 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](https://app.trupeer.ai/view?slug=R9mcuH)**

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.
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,7 @@ module.exports = {
items: [
"kane-ai-javascript-execution",
"kane-ai-geolocation-tunnel-proxy",
"kaneai-auto-heal",
"kane-ai-scroll-in-feature",
"kane-ai-jira-integration",
"kane-ai-api-testing",
Expand Down
Loading