Hacker News new | ask | show | jobs
by alexandriaeden 121 days ago
I've been working on an approach where the test framework caches selector alternatives at the time of a successful match... the element's aria-label, role, ID, class, and text content. When the primary selector fails, it falls back to the alternatives ranked by confidence score, reporting success only if the healed selector has a confidence score above 60%. Basically, self-healing selectors with a confidence gate to avoid silent false passes. Combined with running each test N times and computing a flakiness percentage, you can automatically quarantine tests above a threshold rather than manually triaging them. The hardest part is distinguishing "the test is flaky" from "the product has a race condition" ... same symptom, totally different fix.