Skip to main content
Docs home
Reliability

How selector healing works

After you record a flow, the DOM will change. Healing tries to find the same intent with a new locator before failing the run — fewer false reds on preview deploys.

Execution model

On each step, TestForge first checks whether the original selector still matches. If not, the repair engine walks through strategies in order, scores confidence, and either continues with a repaired selector or surfaces a clear failure with context for a quick manual fix.

Strategies (high level)

Best practice

Add data-testid on critical interactive elements in your Next.js app. Healing works better when at least one stable anchor exists in the hierarchy.