AI Auto-Fix
Automatic error detection and code correction
When tests fail, WellTested’s AI analyzes the error, identifies the root cause, and automatically generates fixed code.
How It Works
When a test step fails:
- Error Detection - System captures error message, stack trace, request/response data
- AI Analysis - AI compares expected vs actual behavior and identifies root cause
- Code Regeneration - AI generates corrected code
- Validation - Fixed code is re-executed automatically
Common Error Types
Assertion Failures
Problem: Expected value doesn’t match actual
# Original
assert response.status_code == 200 # Got 201
# Fixed
assert response.status_code == 201
API Response Changes
Problem: API structure changed
# Original
user_id = response.json()['id'] # KeyError: 'id'
# Fixed
user_id = response.json()['user_id']
Type Mismatches
Problem: Wrong data type
# Original
assert age == "25" # age is int, not str
# Fixed
assert age == 25
Using AI Auto-Fix
When a test fails:
- Click “Analyze Error”
- AI analyzes failure (5-10 seconds)
- Review suggested fix
- Click “Apply Fix”
- Test re-runs automatically
What Can Be Fixed
✅ Assertion adjustments ✅ Field name changes ✅ Type conversions ✅ Error handling ✅ Logic corrections
What Cannot Be Fixed
❌ API unavailable ❌ Invalid credentials ❌ Missing prerequisite data ❌ Wrong environment configuration
Next Steps
- Learn about Test Execution
- Explore Batch Code Generation