Skip to main content

Self-Healing API Tests

ScaleEnterpriseSelf-HostedDedicated

Keploy can automatically fix failing test cases using its built-in AI engine. This is useful when:

  • Your API responses have changed slightly (e.g. new fields, formats)
  • You're handling schema changes, such as added fields, changed date formats, or updated static metadata.
  • You want to fix many tests without editing them one-by-one

🔧 How to Use Self-Healing

  1. Go to the Test Report

    • Navigate to the test report where failures are listed.
  2. Click on a Failed Test

    • Open the specific failing test case you'd like to fix.
  3. Click "Fix with AI"

    • Keploy AI analyzes the diff between the expected and actual response. It then proposes updated assertions, allowing you to review and accept the 'healed' version as the new source of truth.
  4. (Optional) Add Context

    • You can provide hints or expectations to help the AI fix it more precisely.
  5. (Optional) Bulk Fix

    • From the Test Suites page, select multiple suites and click "Fix with AI" to heal them all in one go.
  6. Wait for AI to Heal

    • The process may take a few seconds to complete.
  7. Find Updated Tests

    • Revisit the Test Suites page to view the newly healed tests.

✅ Best Practices

  • Use AI healing after any significant backend changes.
  • Review the updated assertions to ensure correctness.
  • Combine healing with test deduplication to keep your suite clean.