Library › Book 1 › Self-Healing Strategies
Self-Healing Strategies
16.1🔒OverviewTest maintenance is the largest cost center in QA, and self-healing attacks it directly. This chapter builds a three-tier healing strategy…
16.2🔒What "Self-Healing" MeansTraditional self-healing (testRigor, mabl, the commercial wave): when a selector breaks, the tool finds an alternative using heuristics…
16.3🔒The Three Tiers of RecoveryWith ref-driven interaction, "selector broke" becomes "ref went stale." The recovery is a fresh snapshot:
16.4🔒Recovery Strategy Matrix
16.5🔒Implementing Self-Healing in Your FrameworkFor scripted (non-agent) runs, a thin wrapper resolves an element by accessible name from a fresh snapshot:
16.6🔒Self-Healing vs Flaky TestsFlaky test: the test itself is unreliable -- race conditions, timing, external dependencies. Self-healing does not fix this; it masks it…
16.7🔒Tracking Self-Healing EventsLog every healing event for analysis:
16.8🔒Locator Robustness HierarchyThe agent interacts via refs at runtime, but the tests the generator writes (and the healer patches) are .spec.ts files with real locators…
16.9🔒Key Takeaways- Three healing tiers: re-snapshot and re-resolve, screenshot + snapshot analysis, healer-agent session for durable fixes - Playwright's…
16.10🔒Q&ASelf-Assessment Quiz1. How does agent-driven self-healing differ from traditional heuristic self-healing? 2. What does "selector broke" become in a ref-driven…
16.11🔒Exercises[Beginner] Exercise 16.1: Implement smart_click and test it against a page where you deliberately act on a stale ref. Verify it re-resolves…
16.12🔒Career Translation- Designed a three-tier self-healing strategy (snapshot re-resolution by role and accessible name, screenshot-based state analysis…
16.13🔒Q&AInterview Depth CheckPrompt: A test heals itself successfully every run for two weeks. Good sign or bad sign? What action do you take?