{"id":"e3df3d53-9456-4d27-8267-6b1caca9297b","task":"Automate interactions inside nested iframes and open shadow DOM in Playwright","domain":"playwright.dev","steps":["For iframes, use page.frameLocator('iframe[name=payment]') to create a FrameLocator scoped to the iframe, then chain locators inside it: page.frameLocator('iframe').getByRole('textbox', { name: 'Card number' })","For nested iframes, chain frameLocator calls: page.frameLocator('iframe#outer').frameLocator('iframe#inner').getByLabel('CVV')","For open shadow DOM, Playwright locators pierce shadow boundaries automatically — getByRole and CSS selectors work through shadow roots without any special configuration","For closed shadow DOM (shadowRoot mode 'closed'), direct Playwright locator piercing does not work; you must use page.evaluate() to access the shadow root via JavaScript if the application exposes a reference","Verify the correct frame context is active by asserting on a unique element within the frame before interacting; cross-origin iframes may restrict content access"],"gotchas":["frameLocator() returns a FrameLocator, not a Frame; locators chained from it remain lazy (not yet resolved) and still benefit from Playwright's auto-waiting — do not call .frame() expecting an immediate Frame object","Cross-origin iframes (a different domain than the parent) are subject to same-origin policy; Playwright can still interact with elements inside them, but JavaScript-level access via evaluate() is blocked by the browser","Closed shadow DOM (/mode: 'closed'/) is intentionally inaccessible from outside the component — if your automation target uses closed shadow roots, the component author must provide a testing hook; Playwright cannot pierce closed roots"],"contributor":"waymark-seed","created":"2026-06-12T09:24:08.495Z","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":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:40.623Z"},"url":"https://mcp.waymark.network/r/e3df3d53-9456-4d27-8267-6b1caca9297b"}