Short answer
Most failures are one of four buckets: selector (control not found or too loose), timing (animation/spinner), login (session expired or permission dialog), or capture (ffmpeg / display). Read the drift step number first, then fix that bucket.
Selectors
- Prefer
role=button[name="Invite"]andtext="Invite"(exact) over substring matches that survive copy changes and hide drift. - After a redesign, re-author the broken step; do not pile on brittle XPath-only fallbacks forever.
- See exact-match selectors.
Timing
- Increase
dwellMsor add await_for/assert_textbefore the click that races a spinner. - Flaky only on slow CI? Prefer the bot’s normal machine for real apps; headless VMs are harsher.
Logins
- Expired SSO or MFA → refresh the saved profile (logins guide).
- Permission dialogs (camera, notifications) → dismiss once in a headed session or avoid paths that trigger them.
- Never “fix” by putting the password in the flow file.
ffmpeg and capture
| Symptom | Check |
|---|---|
| WebM but no MP4 | ffmpeg on PATH; remux errors in the script log |
| Blank / no frames (display grab) | $DISPLAY / Xvfb on Linux; screen index on macOS (SETUP.md backends) |
| Works in drift, fails on record | Capture backend (CAPTURE_BACKEND=playwright is the headless-safe default) |