playwright-cli

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

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/sonth87/Redprint --skill playwright-cli-sonth87
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/sonth87/Redprint/tree/main/.agents/skills/playwright-cli
Command: npx skills add https://github.com/sonth87/Redprint --skill playwright-cli-sonth87

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Manually testing web applications, filling forms, and extracting data from websites is repetitive and error-prone. This Skill lets you drive a real browser through simple CLI commands, capturing page snapshots, interacting with elements, and recording sessions without writing test code first. ## Core Features & Use Cases - Browser Automation: Open pages, click elements, fill forms, navigate, and manage tabs using element refs from accessibility snapshots. - Session & Storage Management: Run isolated named browser sessions, save and restore cookies, localStorage, and full authentication state. - Network & Debugging Tools: Mock API requests, capture console logs, record traces and videos, and generate Playwright test code from your actions. - Use Case: Log into a web app once, save the authenticated state with state-save, then reuse it across future automation runs to skip the login flow entirely. ## Quick Start Ask the AI 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 browser interactions with playwright-cli?▼

Run playwright-cli open with a URL, then use snapshot to get element refs like e5. Interact using commands such as click e5, fill e1 "text", and press Enter. Each command returns an updated page snapshot.

How do I fill and submit a web form using Playwright?▼

Open the page, take a snapshot to identify field refs, then use playwright-cli fill with each field's ref and value. Finish with playwright-cli click on the submit button's ref and verify the result with another snapshot.

Can I reuse login sessions across browser automation runs?▼

Yes. After logging in, run playwright-cli state-save auth.json to capture cookies and localStorage. Later, run playwright-cli state-load auth.json before opening the site to restore the authenticated state and skip login.

Does playwright-cli support running multiple isolated browser sessions?▼

Yes. Use the -s flag with a session name, such as playwright-cli -s=auth open example.com. Each named session has independent cookies, storage, cache, and tabs, and can be managed with list, close, and close-all.

How do I mock API requests during browser testing?▼

Use playwright-cli route with a URL pattern and options like --status=404 or --body to return mock responses. For conditional logic or response modification, use run-code with page.route in custom Playwright code.

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 locally installed package without requiring a global installation.