|
| 1 | +--- |
| 2 | +id: kaneai-auto-heal |
| 3 | +title: Auto-Heal for Automation Scripts in KaneAI with HyperExecute |
| 4 | +hide_title: false |
| 5 | +sidebar_label: Auto-Healing |
| 6 | +description: This documentation will help you to understand how auto-healing works on KaneAI |
| 7 | +keywords: |
| 8 | +- auto-heal |
| 9 | +- locators |
| 10 | +- kane ai |
| 11 | +url: https://www.lambdatest.com/support/docs/kaneai-auto-heal/ |
| 12 | +site_name: LambdaTest |
| 13 | +slug: kaneai-auto-heal/ |
| 14 | +--- |
| 15 | + |
| 16 | +<script type="application/ld+json" |
| 17 | + dangerouslySetInnerHTML={{ __html: JSON.stringify({ |
| 18 | + "@context": "https://schema.org", |
| 19 | + "@type": "BreadcrumbList", |
| 20 | + "itemListElement": [{ |
| 21 | + "@type": "ListItem", |
| 22 | + "position": 1, |
| 23 | + "name": "Home", |
| 24 | + "item": "https://www.lambdatest.com" |
| 25 | + },{ |
| 26 | + "@type": "ListItem", |
| 27 | + "position": 2, |
| 28 | + "name": "Support", |
| 29 | + "item": "https://www.lambdatest.com/support/docs/" |
| 30 | + },{ |
| 31 | + "@type": "ListItem", |
| 32 | + "position": 3, |
| 33 | + "name": "Auto-Healing", |
| 34 | + "item": "https://www.lambdatest.com/support/docs/kaneai-auto-heal/" |
| 35 | + }] |
| 36 | + }) |
| 37 | + }} |
| 38 | +></script> |
| 39 | + |
| 40 | +## What is Auto-Heal in KaneAI & HyperExecute? |
| 41 | + |
| 42 | +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. |
| 43 | + |
| 44 | +**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. |
| 45 | + |
| 46 | + |
| 47 | +## How is Auto-Heal Implemented? |
| 48 | + |
| 49 | +### Multi-Locator Fallback Approach |
| 50 | + |
| 51 | +- Every element identified by KaneAI comes with **multiple locators** (XPath, CSS, ID, etc.) at the time of script generation. |
| 52 | +- During execution on HyperExecute, if the primary locator fails, the script automatically tries fallback locators sequentially. |
| 53 | + |
| 54 | +### Locator Healing via Natural Language Understanding |
| 55 | + |
| 56 | +- If **all locators fail**, KaneAI doesn't stop there. |
| 57 | +- It re-evaluates the **original natural language instruction** that generated the test step. |
| 58 | +- 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”). |
| 59 | +- The test step continues without manual intervention, ensuring minimal test flakiness and faster issue resolution. |
| 60 | + |
| 61 | + |
| 62 | +## Complexity of Auto-Heal Logic |
| 63 | + |
| 64 | +The core logic of Auto-Heal integrates several sophisticated systems working in real-time: |
| 65 | + |
| 66 | +1. **Locator Redundancy and Priority Mapping:** |
| 67 | + - Prioritized fallback locators based on confidence scores. |
| 68 | + |
| 69 | +2. **Natural Language Parsing with Context Awareness:** |
| 70 | + - Re-parsing instructions with contextual understanding of nearby elements, page structure, and DOM hierarchy. |
| 71 | + |
| 72 | +3. **Visual Query Integration (where applicable):** |
| 73 | + - When locators cannot be determined purely through DOM, KaneAI utilizes **visual queries** to identify elements based on their appearance and relative positioning. |
| 74 | + |
| 75 | +4. **Scope of Auto-Heal:** |
| 76 | + - Any command that requires the use of an element locator, such as **Click**, **Type**, or **Hover**, falls under the purview of auto-heal. |
| 77 | + |
| 78 | + |
| 79 | +## Benefits of Auto-Heal |
| 80 | + |
| 81 | +- ✅ **Reduced Test Maintenance Effort:** |
| 82 | + No need to manually update locators when the application UI changes. |
| 83 | + |
| 84 | +- ⚡ **Increased Automation Stability:** |
| 85 | + Avoid flaky tests caused by minor DOM updates or attribute changes. |
| 86 | + |
| 87 | +- 🧠 **AI-Native Healing with Context:** |
| 88 | + Uses the original intent behind instructions to intelligently recover from failures. |
| 89 | + |
| 90 | +- ⏱️ **Faster Execution with HyperExecute:** |
| 91 | + Combined with the speed of HyperExecute, the healing process occurs in real-time without significant delays. |
| 92 | + |
| 93 | +- 📉 **Lower Failure Rate in CI/CD Pipelines:** |
| 94 | + Ensures test cases remain green more consistently, even with frequent app changes. |
| 95 | + |
| 96 | + |
| 97 | +## Future Additions to Auto-Heal (In roadmap) |
| 98 | + |
| 99 | +- 🧭 **Detailed Healing Reports:** |
| 100 | + Automatic reporting of healed locators, fallback paths taken, and suggestions for locator improvements. |
| 101 | + |
| 102 | +- 📌 **Auto-Update Healed Locators:** |
| 103 | + Automatically update auto-healed locators in a new version of the test case script generated by KaneAI, further reducing maintenance overhead. |
| 104 | + |
| 105 | + |
| 106 | +## Video Explanation |
| 107 | + |
| 108 | +🎥 **[Watch the Demo: How Auto-Heal Works in KaneAI with HyperExecute](https://app.trupeer.ai/view?slug=R9mcuH)** |
| 109 | + |
| 110 | +The video walkthrough explains: |
| 111 | +- How KaneAI generates scripts with fallback locators. |
| 112 | +- Demo of locator failure and Auto-Heal in action. |
| 113 | +- How KaneAI dynamically finds new locators using the original instruction. |
0 commit comments