Skip to main content

Tabs

CommandDescription
tab-listList all open tabs
tab-new [url]Open a new tab
tab-select <index>Switch to tab by index
tab-close [index]Close a tab

Listing tabs

$ playwright-cli tab-list
# Tab 0: "TodoMVC" - https://demo.playwright.dev/todomvc [active]
# Tab 1: "Example" - https://example.com
# Tab 2: "Google" - https://google.com

Creating tabs

playwright-cli tab-new                  # blank tab
playwright-cli tab-new https://example.com # navigate immediately

Switching tabs

playwright-cli tab-select 1             # switch to second tab
playwright-cli tab-select 0 # switch back to first

Closing tabs

playwright-cli tab-close                # close current tab
playwright-cli tab-close 2 # close specific tab

Workflow: comparing pages

playwright-cli open https://staging.example.com
playwright-cli snapshot --filename=staging.yaml
playwright-cli tab-new https://example.com
playwright-cli snapshot --filename=production.yaml
# Agent compares the two snapshots