All skills
openai avatar

/playwright

@2d665c9 official
by openaiopenai/skills28k stars
1,891

Use when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction, UI-flow debugging) via `playwright-cli` or the bundled wrapper script.

Use this Skill: https://skilld.dev/gh/openai/skills/playwright

This session only. Nothing lands on disk.

referencesworkflows.md

≈466 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Playwright CLI Workflows

Use the wrapper script and snapshot often. Assume PWCLI is set and pwcli is an alias for "$PWCLI". In this repo, run commands from output/playwright/<label>/ to keep artifacts contained.

Standard interaction loop

pwcli open https://example.com
pwcli snapshot
pwcli click e3
pwcli snapshot

Form submission

pwcli open https://example.com/form --headed
pwcli snapshot
pwcli fill e1 "user@example.com"
pwcli fill e2 "password123"
pwcli click e3
pwcli snapshot
pwcli screenshot

Data extraction

pwcli open https://example.com
pwcli snapshot
pwcli eval "document.title"
pwcli eval "el => el.textContent" e12

Debugging and inspection

Capture console messages and network activity after reproducing an issue:

pwcli console warning
pwcli network

Record a trace around a suspicious flow:

pwcli tracing-start
# reproduce the issue
pwcli tracing-stop
pwcli screenshot

Sessions

Use sessions to isolate work across projects:

pwcli --session marketing open https://example.com
pwcli --session marketing snapshot
pwcli --session checkout open https://example.com/checkout

Or set the session once:

export PLAYWRIGHT_CLI_SESSION=checkout
pwcli open https://example.com/checkout

Configuration file

By default, the CLI reads playwright-cli.json from the current directory. Use --config to point at a specific file.

Minimal example:

{
  "browser": {
    "launchOptions": {
      "headless": false
    },
    "contextOptions": {
      "viewport": { "width": 1280, "height": 720 }
    }
  }
}

Troubleshooting

  • If an element ref fails, run pwcli snapshot again and retry.
  • If the page looks wrong, re-open with --headed and resize the window.
  • If a flow depends on prior state, use a named --session.

Source: SKILL.md on GitHub

2 warnings17d5 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    This skill includes some security considerations such as terminal command execution and an indirect prompt injection surface inherent to browser automation workflows. While these areas warrant review, they are standard components of the skill's intended functionality for web interaction.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: MEDIUM · 1 issue

  • Runlayer7mo

    7/7 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 2d665c9. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Activeupdated 8 months ago
  • CLI
  • Debugging
  • playwright
  • browser-automation
  • e2e-testing
  • web-scraping
  • form-filling
  • screenshots

README badge

README badge for openai/skills/playwright

Automates browser navigation, form filling, screenshots, and data extraction via `playwright-cli`, using a wrapper script that works without a global install. Targets terminal-driven UI automation and debugging workflows, not test file generation.

Generated from the current SKILL.md.

Does this skill use Playwright Test, or just the CLI?
It uses the Playwright CLI for terminal-driven automation. Test files are not the default; use this for navigation, form filling, screenshots, and UI debugging via `playwright-cli` commands.
Do I need to install Playwright globally?
No. The bundled wrapper script uses `npx` to run `@playwright/cli` without a global install. A global install is optional if your repo already standardizes on it.
What do I need to have installed before using this skill?
Node.js and npm (which provide `npx`). If missing, install Node.js, then you can proceed with the wrapper script.
How do I reference elements after taking a snapshot?
Snapshot generates stable element refs like `e1`, `e2`, `e3`. Use these refs in click, fill, and other interaction commands. Re-snapshot if refs become stale after navigation or DOM changes.
Can I use this skill to debug UI flows?
Yes. Use the `--headed` flag to open a visible browser, and `tracing-start` / `tracing-stop` to capture execution traces for debugging.

Generated from the current SKILL.md. These answers refresh after source changes.