playwright-cli

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

1|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/AlahmadiQ8/sre-agent-demo --skill playwright-cli-alahmadiq8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/AlahmadiQ8/sre-agent-demo/tree/main/.claude/skills/playwright-cli
Command: npx skills add https://github.com/AlahmadiQ8/sre-agent-demo --skill playwright-cli-alahmadiq8

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 scraping data from websites is repetitive and error-prone. This Skill drives a real browser through the playwright-cli command line, letting you navigate pages, click elements, fill forms, and capture page state without writing test scripts from scratch. ## Core Features & Use Cases - Browser Automation: Open pages, click elements by snapshot refs, fill forms, press keys, and manage tabs across Chrome, Firefox, WebKit, and Edge. - Session & State Management: Run isolated named browser sessions, save and restore cookies/localStorage auth state, and reuse login sessions. - Network & Debugging Tools: Mock or block network requests, capture console logs, record traces and videos, and generate Playwright TypeScript test code from your actions. - Use Case: Log into a web app once, save the auth state with state-save, then reuse it across sessions to scrape dashboard data or verify a checkout flow without re-authenticating. ## Quick Start Ask the assistant to open a website with playwright-cli, take a snapshot of the page, and click or fill the elements you specify.

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 with playwright-cli?

Open the page with playwright-cli open, run snapshot to get element refs, then use fill with the ref and value for each field and click the submit button. Each command returns an updated page snapshot so you can verify the result.

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 opening the site to restore the authenticated session without logging in again.

Which browsers does playwright-cli support?

playwright-cli supports Chrome, Firefox, WebKit, and Microsoft Edge via the --browser flag on the open command. It can also connect through a browser extension or use persistent profiles for saved user data.

Can playwright-cli mock API responses during testing?

Yes, the route command intercepts URL patterns and returns custom status codes, bodies, or headers. For conditional logic or response modification, use run-code with page.route to inspect requests and fulfill them dynamically.

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

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

What should I do if the playwright-cli command is not found?

If the global binary fails, prefix commands with npx, for example npx playwright-cli open https://example.com. This runs the package through npm without requiring a global installation.