Automate browser tabs (alias for playwright-cli).

Synopsis

playwright <command> [args...]

Description

Automates real browser tabs: navigate, click, type, snapshot the accessibility tree, screenshot, and evaluate JavaScript. Most commands operate on a tab and require --tab=<targetId>; there is no implicit current tab, so run 'playwright-cli tab-list' (or the equivalent tab-list command) to get tab IDs first. This name is an alias; behavior is identical to playwright-cli.

Options

open [url|/vfs/path] [--foreground|--fg] [--runtime=<id>] [--discover] [--mobile] Open a new tab, in the background by default.

goto|navigate <url> --tab=<id> [--discover] Navigate a tab to a URL.

fetch <url> [--method=<verb>] [--discover] Fetch a URL through the proxied fetch, parsing RFC 8288 Link headers.

click <ref> --tab=<id> Click an element by ref (e.g. e5).

type <text> --tab=<id> [--submit] Type text into the focused element.

fill <ref> <text> --tab=<id> [--submit] Fill an input by ref with text.

snapshot --tab=<id> [--frame=<frameId>] [--depth=<n>] [--boxes] Print the tab's accessibility tree.

find [text] --tab=<id> [--regex=<re>] Search the page snapshot for text or a regexp.

screenshot [ref] --tab=<id> [--filename=path] [--fullPage] Take a screenshot.

eval <expression> --tab=<id> Evaluate JavaScript in a tab or frame.

teleport --tab=<id> --start <regex> --return <regex> Arm a teleport watcher for human-assisted auth.

Examples

$ playwright open https://example.com

Open a background tab.

$ playwright snapshot --tab=T1

Print the accessibility tree of tab T1.

$ playwright click e5 --tab=T1

Click element e5 in tab T1.

Notes

See playwright-cli --help for the full command list; puppeteer is a second alias for the same tool.

See Also

playwright-cli, puppeteer