playwright-cli

Automates browser interactions for web testing, form filling, screenshots, and data extraction.

Updated Jun 28, 2026
One-click install
npx skills add https://github.com/AO-HyS/aohys.com --skill playwright-cli-ao-hys
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/AO-HyS/aohys.com/tree/main/.agents/skills/playwright-cli
Command: npx skills add https://github.com/AO-HyS/aohys.com --skill playwright-cli-ao-hys

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright-cli, and includes references (resource) components.

What problem does it solve? Manually testing web pages, filling forms, and extracting data from websites is repetitive and error-prone. This Skill drives a real browser through the playwright-cli command line so an AI agent can navigate pages, click elements, fill forms, and capture page state without writing a full test script first. ## Core Features & Use Cases - Interactive Browser Control: Open pages, click, type, fill forms, hover, drag, and press keys using element refs from accessibility snapshots. - Session and Storage Management: Run multiple isolated named browser sessions, save and restore cookies, localStorage, and full authentication state. - Network Mocking and Debugging: Intercept requests with custom responses, capture console logs, network traffic, traces, screenshots, PDFs, and video recordings. - Use Case: Verify a login flow by opening the page, filling credentials via snapshot refs, saving the authenticated storage state to a file, and reusing it in later sessions to skip repeated logins. ## Quick Start Open https://example.com in a browser, take a snapshot, fill in the login form, click submit, and save a screenshot of the result.

Frequently Asked Questions about playwright-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate form filling in a browser from the command line?▼

Open the page with playwright-cli open, run snapshot to get element refs, then use fill or type with those refs to enter values and click to submit. Each command returns an updated snapshot so you can chain interactions reliably.

How to save and reuse login sessions in Playwright?▼

After logging in, run playwright-cli state-save auth.json to capture cookies and localStorage. Later, run state-load auth.json before navigating, and the browser restores the authenticated state without repeating the login flow.

Can playwright-cli mock API responses during testing?▼

Yes, the route command intercepts URL patterns and returns custom status codes, bodies, or headers, such as route "**/api/users" --body='[{"id":1}]'. For conditional logic or response modification, use run-code with page.route.

Does playwright-cli support multiple isolated browser sessions?▼

Yes, the -s flag creates named sessions with independent cookies, storage, cache, and tabs. You can run sessions concurrently, list them with playwright-cli list, and clean up with close-all or kill-all.

What is the difference between tracing and video recording in Playwright?▼

Tracing captures DOM snapshots, network activity, console logs, and step-by-step actions for debugging, while video recording produces a WebM file of the visual session. Use tracing for analysis and video for demos or documentation.