Skip to main content

Two Ways UI Tests Fail on Rerun

When you rerun a UI test that previously passed, one of two things has changed: A plain rerun can’t tell these apart. Auto-Heal can: the test recovers from the first kind, and the second kind still fails, as it should.
In the web portal, Auto-Heal is built into UI reruns; there’s no toggle to switch on. Not every plan includes Auto-Heal. Compare plans on the pricing page.

What Auto-Heal Does

TestSprite runs your saved test. If the page changed but the flow still works, the test recovers and is marked Passed; if the flow is broken, it stays Failed. Tests stay green through refactors, design system swaps, and copy edits without anyone editing them by hand, while real bugs still surface.

When Auto-Heal Helps and When It Doesn’t

It helps with UI drift:
  • Minor refactors: renamed buttons (Submit → Save), navigation moved into a hamburger menu, a wrapper element added around a form field.
  • Design system swaps: a custom dropdown replaced with a shadcn Select, with a new DOM and accessibility roles. Auto-Heal re-binds the test to the new component.
  • Copy edits: “Continue” became “Next”. Anything matching by text breaks on plain replay; Auto-Heal sees the rename in context.
It doesn’t help with:
  • Real product bugs: a required field rejects valid input, an API returns 500, a redirect goes to the wrong page. The test stays Failed, which is the correct outcome. Auto-Heal absorbs UI drift; it doesn’t make tests pass.
  • Removed features: if the flow was deleted on purpose, remove the test from your suite. Auto-Heal can’t tell intentional removal from a regression.
  • A broken login or onboarding gate: if the sequence before the flow is what broke, recovery can’t get past it. Keep your test account in a known state.

Why Frontend-Only

Auto-Heal applies only to UI tests. API tests issue HTTP requests, and routes don’t drift the way a UI does without an explicit version bump. When an API test fails on rerun, the cause is usually one of these:

Endpoint behaves differently

A real bug. The failing assertion and the recorded request/response usually show what changed.

Auth token expired

Configure Auto-Auth so a fresh token is fetched before every run.

Required fixture was deleted

Check Auto Cleanup and your dependency chains: a producer’s record may have been removed before its consumer ran.

Edge Cases & Troubleshooting

Open the test detail page and look at the Steps list in its left column. Your saved test stays the source of truth; Auto-Heal doesn’t overwrite it unless you explicitly save updates.
Yes. Recovery covers the whole step sequence: steps that still work are reused, and broken ones are re-decided in context.
The test is marked Failed with the last-known error in the Error / Cause / Fix tabs of the test detail page. Click Run test to try again. If recovery keeps erroring on a test, contact support with the test ID.

Where to Go Next

Edit & Rerun

The rerun surfaces: single, batch, scheduled

Test Schedules

Set up nightly schedules

Insights

Regressions and quality trends across runs