playwright-cli

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

4|1|Updated Dec 16, 2023
One-click install
npx skills add https://github.com/Shtian/AuthentiClash --skill playwright-cli-shtian
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/Shtian/AuthentiClash/tree/main/.claude/skills/playwright-cli
Command: npx skills add https://github.com/Shtian/AuthentiClash --skill playwright-cli-shtian

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 page data is repetitive and error-prone. This Skill drives a real browser through the playwright-cli command line so an AI agent can navigate sites, click elements, fill inputs, and capture page state without writing test scripts first. ## Core Features & Use Cases - Interactive Browser Control: Open pages, click, type, fill forms, drag elements, and press keys using element refs from accessibility snapshots. - State and Session Management: Run multiple isolated named browser sessions, save and restore cookies/localStorage auth state, and use persistent profiles. - Network Mocking and Debugging: Intercept requests with custom responses, capture console logs, network activity, traces, and video recordings. - Use Case: Verify a login flow on a staging app by opening the page, filling credentials via snapshot refs, submitting the form, saving the authenticated storage state, and reusing it to skip login in later runs. ## Quick Start Ask the AI to open your web app in a browser with playwright-cli, take a snapshot, fill in the login form, and click the submit button.

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 from the command line?▼

Use playwright-cli to open a page, take a snapshot to get element refs, then run commands like click, fill, and type against those refs. Each command returns an updated snapshot of the page state for the next step.

How to fill and submit a web form with playwright-cli?▼

Open the form page, run snapshot to identify field refs, then use fill with each ref and value, and click the submit button ref. A final snapshot confirms the submission result.

Can I reuse login sessions across browser automation runs?▼

Yes. After logging in, run state-save to write cookies and localStorage to a JSON file, then state-load in a later session to restore the authenticated state and skip the login flow.

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

Yes. Use the -s flag with a session name to run isolated browsers concurrently, each with independent cookies, storage, cache, and tabs. List sessions with playwright-cli list and clean up with close-all.

How do I mock API responses during browser testing?▼

Use the route command with a URL pattern and options like --status, --body, or --header to intercept requests. For conditional logic or response modification, use run-code with page.route in custom Playwright code.

What should I do if the playwright-cli binary fails to run?▼

If the globally installed 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 install.