The Stagehand Page
Stagehand automatically adapts to multitab workflows. Thestagehand.page
object always points to the most recently opened or active tab, ensuring your automations continue working even when new tabs are created.
This means you can continue using familiar patterns:
Important: Stagehand Agent will always operate on the
stagehand.page
. If you need an agent to work across specific tabs, you’ll need to manage page switching manually.Manual Page Management
For more control or multitab workflows, you can manage multiple tabs explicitly:Handling Tab Events
You can also listen for tab events to control what happens when new tabs are opened:Next Steps
Orchestrate complex workflows with Agent
Use
Agent
to autonomously execute multi-step tasks and complex workflows.Working with iframes
Learn best practices for interacting with elements inside iframes.
Browser Configuration
Manage browser contexts and sessions for complex automation scenarios.
Logging & Debugging
Handle errors gracefully and debug automation issues effectively.