playwright-cli

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Manually driving a browser to test web pages, fill forms, or scrape data is slow and error-prone. This Skill lets an agent control a real browser through the playwright-cli command line, turning multi-step web interactions into simple scripted commands. ## Core Features & Use Cases - Browser Automation: Open pages, click elements, fill forms, press keys, and navigate using element refs from accessibility snapshots. - Session & State Management: Run multiple isolated named browser sessions, save and restore cookies/localStorage auth state, and manage tabs. - Debugging & Capture: Record traces, videos, screenshots, console logs, and network activity, plus mock network requests for testing. - Use Case: Ask the agent to log into a web app, save the authenticated state to a file, then reuse that state in later sessions to skip the login flow entirely. ## Quick Start Ask the agent 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 with commands such as click, fill, type, and press, and finish with close to stop the browser.

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 element ref and value. Click the submit button ref and snapshot again to verify the result.

Can playwright-cli run multiple browser sessions at once?▼

Yes, use the -s flag to create named sessions with isolated cookies, storage, and tabs. Commands like playwright-cli -s=mysession open keep each session independent, and close-all stops them all.

How do I save and reuse login state 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.

Can playwright-cli mock network requests for 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 in Playwright JavaScript.

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

Tracing captures DOM snapshots, network activity, and console logs for step-by-step debugging in Trace Viewer. Video recording produces a WebM file of the session, which suits demos and documentation rather than analysis.