Overview
Auto-Healing is Supatest’s AI-powered feature that automatically repairs tests when locators break due to UI changes. Instead of failing immediately when an element can’t be found, Auto-Healing uses AI to locate the correct element and continue execution.How Auto-Healing Works
The Problem
UI changes frequently break tests:- Developers update CSS classes
- Elements get new IDs
- Page structure changes
- Text content updates
The Solution
When a step fails to find its element:Enabling Auto-Healing
Per-Test Setting
- Open test in Editor
- Click Settings (gear icon)
- Find Auto-Healing toggle
- Enable or disable
Organization Default
- Go to Settings → Organization
- Find Default Test Settings
- Set Auto-Healing default
- Applies to new tests
Per-Step Override
Individual steps can override the test setting:- Open step configuration
- Find Auto-Healing option
- Enable, disable, or use test default
What Auto-Healing Uses
When healing a step, AI considers:Step Information
| Data | How It Helps |
|---|---|
| Step type | Knows what kind of element to find (button, input, etc.) |
| Step description | Natural language context |
| Original locator | Starting point for finding similar elements |
| Fallback locators | Alternative selectors to try |
Page Context
| Data | How It Helps |
|---|---|
| Current URL | Understands page context |
| DOM structure | Finds elements by structure |
| Visible text | Matches by content |
| Element attributes | Identifies by properties |
Historical Data
| Data | How It Helps |
|---|---|
| Previous successful runs | Knows what worked before |
| Healing history | Learns from past repairs |
| Element patterns | Recognizes common UI patterns |
Runtime Behavior
When Auto-Healing Activates
Auto-Healing triggers when:- Primary locator fails to find element
- All fallback locators fail
- Auto-Healing is enabled for the test/step
Execution Flow
Performance Impact
| Scenario | Time Impact |
|---|---|
| Element found normally | No impact |
| Fallback locator works | Minimal (<1s) |
| AI healing required | 2-5 seconds additional |
Reviewing Healing Suggestions
After a run with Auto-Healing:View Suggestions
- Open run results
- Look for “Healed” indicator on steps
- Click to see healing details
Healing Details Show
- Original locator
- New locator found by AI
- Confidence score
- Element screenshot
Accept or Reject
Accept:- Updates the step’s primary locator
- New locator used in future runs
- Improves test stability
- Keeps original locator
- AI tries again next run
- Use when healing was incorrect
Bulk Review
For runs with multiple healed steps:- Open run summary
- Click Review All Healings
- Accept/reject each suggestion
- Apply changes
Best Practices
When to Enable Auto-Healing
Enable for:- Tests in active development
- Pages with frequent UI changes
- Non-critical test paths
- Regression suites
- Tests validating specific elements
- Critical path tests where any change matters
- Tests that should fail on UI changes
Improve Healing Success
-
Write good step descriptions
-
Add fallback locators
- More alternatives = better healing
- Use different strategies (CSS, text, role)
-
Use stable primary locators
- data-testid attributes
- Semantic selectors
- Role-based selectors
-
Keep tests focused
- Smaller tests heal more accurately
- Clear, single-purpose steps
Review Healings Regularly
- Check healing suggestions weekly
- Accept correct healings promptly
- Investigate rejected healings
- Update source locators when patterns emerge
AI Credits
Auto-Healing consumes AI credits:| Action | Credits |
|---|---|
| Healing attempt | 1 credit |
| Successful healing | 1 credit total |
| Failed healing | 1 credit (still consumed) |
Limitations
Auto-Healing Cannot
- Fix logic errors in tests
- Handle missing pages/features
- Repair invalid test data
- Solve authentication issues
Healing May Fail When
- Element was intentionally removed
- Multiple similar elements exist
- Page structure completely changed
- Element requires specific state
Troubleshooting
Healing Not Activating
- Verify Auto-Healing is enabled
- Check AI credit balance
- Ensure step has locator (not AI Action)
Incorrect Healing
- Reject the suggestion
- Update step description for clarity
- Add more specific fallback locators
- Consider manual locator update
Too Many Healing Attempts
If tests constantly need healing:- Review UI change patterns
- Update locators to be more stable
- Add data-testid to application
- Consider if tests need redesign
Related
- Debugging Tests - Troubleshooting failures
- Test Configuration - Test settings
- AI Credits - Credit management
- Editor - Locator configuration

