If you’re using Playwright for end-to-end testing, you should check out Playwright Check Suites and start testing in production.
Locate an iframe and its elements
To access iframe elements, locate the iframe and query the DOM elements as if you’re in the page context.iframe-access.spec.ts