# How does Playwright manage complex elements like iframes, video popups, and shadow DOM?

**URL:** https://club.ministryoftesting.com/t/how-does-playwright-manage-complex-elements-like-iframes-video-popups-and-shadow-dom/73037
**Category:** Discussions
**Tags:** ask-me-anything, playwright, playwrightama
**Created:** [4 January 2024 09:26 UTC](https://club.ministryoftesting.com/t/how-does-playwright-manage-complex-elements-like-iframes-video-popups-and-shadow-dom/73037 "2024-01-04T09:26:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sarahdeery](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/sarahdeery/32/11833_2.png) [@sarahdeery](https://club.ministryoftesting.com/u/sarahdeery)
#### Post date: [4 January 2024 09:26 UTC](https://club.ministryoftesting.com/t/how-does-playwright-manage-complex-elements-like-iframes-video-popups-and-shadow-dom/73037/1 "2024-01-04T09:26:46Z")

</div>

In our recent Ask Me Anything session on Playwright with @utch, we had two closely related questions that delve into handling complex web elements with Playwright:

> 1.“How does Playwright handle iframe and video popups?” - Dhivy Ananth  
> 2. “How can one manage shadow DOM and iframe elements in Playwright?” - Irtassam Arshad

Both questions centre around Playwright’s capabilities in interacting with more challenging web elements like iframes, video popups, and shadow DOM. Your insights and experiences with these aspects of Playwright would be very valuable to the continued discussion.

---

<div class="post-metadata">

### Author: ![ipstefan](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/ipstefan/32/8279_2.png) [@ipstefan](https://club.ministryoftesting.com/u/ipstefan)
#### Post date: [4 January 2024 14:52 UTC](https://club.ministryoftesting.com/t/how-does-playwright-manage-complex-elements-like-iframes-video-popups-and-shadow-dom/73037/2 "2024-01-04T14:52:03Z")

</div>

Are people having a hard time using the Playwright documentation, or do they mean to ask something else other than what’s understood?

> **[FrameLocator | Playwright](https://playwright.dev/docs/api/class-framelocator#frame-locator-frame-locator)**
>
> FrameLocator represents a view to the iframe on the page. It captures the logic sufficient to retrieve the iframe and locate elements in that iframe. FrameLocator can be created with either page.frameLocator() or locator.frameLocator() method.

> **[Video | Playwright](https://playwright.dev/docs/api/class-video)**
>
> When browser context is created with the recordVideo option, each page has a video object associated with it.

> **[Locators | Playwright](https://playwright.dev/docs/locators#locate-in-shadow-dom)**
>
> Introduction
