window
Manage browser tabs and windows: list handles, switch tabs, open or close windows, and resize the viewport for responsive or mobile testing.
Instructions
Manage browser tabs and windows, and resize the viewport. list = all window handles plus the current one; switch = go to a handle from list; switch_latest = go to the newest tab/window (e.g. after a link opened a new tab); new_tab / new_window = open a blank one and switch to it; close = close the current one (then switch to another handle). resize = set the viewport (page area) to width x height for responsive or mobile testing, e.g. 390x844 phone, 768x1024 tablet, 1920x1080 desktop (exact phone sizes use device emulation on Chrome/Edge); maximize = maximize the window. Returns window handles, or the resulting window and viewport sizes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | Viewport width in CSS pixels for resize (e.g. 390 phone, 768 tablet, 1920 desktop). Required for resize. | |
| action | Yes | What to do: list | switch | switch_latest | new_tab | new_window | close | resize | maximize. | |
| handle | No | Window handle to switch to, as returned by action list. Required for switch; ignored otherwise. | |
| height | No | Viewport height in CSS pixels for resize (e.g. 844 phone, 1024 tablet, 1080 desktop). Required for resize. |