switchFrame
Direct browser automation into any iframe, including cross-origin frames, so subsequent commands act on that frame. Reset to the main frame with no arguments.
Instructions
Set the active frame so click/type/hover/analyzePage/find/executeScript/waitForElement run INSIDE it — required to automate cross-origin iframes (resolved via CDP, bypassing Same-Origin Policy). Call with no args to reset to the main frame. Auto-resets on navigateTo.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| frameUrl | No | Substring matched against each frame's URL (e.g. 'app.example.com'). Mutually exclusive with frameSelector. | |
| frameSelector | No | CSS selector of the <iframe> element; its content frame becomes active. Mutually exclusive with frameUrl. |