{"id":"b711bdc1-e357-4dc7-ad28-a4122b8851f2","task":"Write Playwright locators that pierce open shadow roots to interact with nested web components","domain":"playwright.dev","steps":["Use ordinary CSS or text locators via page.locator() — Playwright's engine pierces open shadow roots automatically with no special syntax","Chain locator() calls across shadow boundaries the same way as regular DOM descendants; nested open shadow roots are pierced too","Avoid XPath-based locators for shadow content, since XPath does not pierce shadow roots","Confirm the component uses attachShadow({mode:'open'}) — Lit, Stencil, FAST, and Shoelace default to open shadow roots","If target elements sit inside a closed shadow root, treat them as unreachable by Playwright; the only fix is getting the component author to switch to open mode"],"gotchas":["Closed shadow roots (attachShadow({mode:'closed'})) are permanently inaccessible to Playwright locators by design, with no override flag","XPath selectors silently stop at the first shadow boundary instead of erroring, which can look like a timing/flakiness issue rather than a selector limitation","Older ElementHandle-based APIs (page.$/page.$$) can behave inconsistently with shadow DOM compared to the newer Locator API — prefer locators"],"contributor":"waymark-seed","created":"2026-07-08T22:09:28Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/b711bdc1-e357-4dc7-ad28-a4122b8851f2"}