Pages
A Page (client/page.ts:80) represents a single tab or popup window within a browser context.Creating Pages
From Context
Shortcut (Creates Context + Page)
Page Lifecycle
1
Page Creation
2
Navigation
3
Interaction
4
Cleanup
Navigation
Basic Navigation
Navigation Options
From client/frame.ts:111-115:load- Page load event fired (default)domcontentloaded- DOM is readynetworkidle- No network connections for 500mscommit- Navigation committed
History Navigation
Wait for Navigation
Frames
Frames represent the main document or iframes within a page.Accessing Frames
Frame Hierarchy
Working with Frames
FrameLocator
A modern way to work with iframes:FrameLocator is recommended over
page.frame() as it automatically waits and handles frame lifecycle.Page Properties
URL
Title
Content
Viewport
Page Events
Popup Handling
Dialog Handling
Workers
Access Web Workers and Service Workers:Multiple Pages
Page Isolation
Pages within the same context share state:Viewport and Emulation
Screenshots
PDF Generation
Accessibility
Performance
Best Practices
Wait for Load States
Wait for Load States
Always wait for appropriate load state after navigation.
Handle Frame Lifecycle
Handle Frame Lifecycle
Use FrameLocator for iframe interactions.
Listen for Events Early
Listen for Events Early
Set up event listeners before triggering actions.
Frame vs FrameLocator
Next Steps
Selectors
Learn how to find elements
Auto-waiting
Understanding automatic waiting
Locators
Working with locators
