Checkly Docs home page
Search...
⌘K
Home
Dashboard
Dashboard
Search...
Navigation
Interaction
How to Handle iFrames in Playwright
Docs
Constructs
CLI
API
Guides
Learn
Comparisons
Playwright
Overview
Getting Started
What is Playwright?
Setting up Playwright
The Layers of the Testing Pyramid
Interaction
Assertions
Clicking and typing
Interacting with iframes
Navigation
UI selectors
Waits and timeouts
Basics
Authentication
Codegen
Emulating mobile devices
Generating PDFs
Detecting broken links
Intercepting requests
Mocking API Responses
Multiple tabs
Taking screenshots
Parallel testing
Best Practices
Complex workflows
Test data
Parameterizing Projects
Performance
Scraping behind a login
Script recorders
Automatic Steps
Test Fixtures
Testing APIs
Scraping
Testing
E2E Examples
TOTP Authentication
Checkout
Downloading files
Google Auth
Search
Standard authentication
Microsoft Live Auth
Discounts & coupons
File uploads
User signup
Debugging
Common issues
Debugging scripts
Click not executed
Element not found
Element not visible
Target closed
Wait not respected
On this page
Locate an iframe and its elements
Further reading
Interaction
How to Handle iFrames in Playwright
Copy page
Copy page
Playwright enables us to access and interact with iframes.
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
Copy
// Example code - see original file for details
Further reading
Playwright’s “Frames documentation”
How to Click, Type, and Hover with Playwright
Previous
How to Use Playwright to Navigate and Interact with Web Pages
Next
Assistant
Responses are generated using AI and may contain mistakes.