Skip to content
Back to skills

Test Playwright

ASecurity

Browser automation via Playwright MCP through mcporter. Use when you need to navigate pages, extract data, take screenshots, interact with UI elements, or scrape web content. All tools called via mcporter to avoid context pollution.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 28, 2026
ai-agentsjavascriptgojavabashtestingfrontend

Works with

  • cli
  • mcp

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned May 28, 2026

npx -y skills add spideynolove/claude-code-in-action --skill test-playwright --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Test Playwright?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Test Playwright
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/spideynolove-test-playwright/badge)](https://www.skillsdirectory.com/skills/spideynolove-test-playwright)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: playwright
description: Browser automation via Playwright MCP through mcporter. Use when you need to navigate pages, extract data, take screenshots, interact with UI elements, or scrape web content. All tools called via mcporter to avoid context pollution.
---

# Playwright (MCPorter)

All tools called via mcporter:

```bash
npx mcporter call playwright.TOOL_NAME [args]
```

## Core Workflow

### Navigate
```bash
npx mcporter call playwright.browser_navigate url:"https://example.com"
```

### Snapshot (preferred for data extraction — better than screenshot)
```bash
npx mcporter call playwright.browser_snapshot
# Save to file to avoid flooding context:
npx mcporter call playwright.browser_snapshot filename:"snapshot.md"
```

### Screenshot
```bash
npx mcporter call playwright.browser_take_screenshot type:png filename:"page.png"
npx mcporter call playwright.browser_take_screenshot type:png fullPage:true filename:"full.png"
```

### Wait for dynamic content
```bash
npx mcporter call playwright.browser_wait_for text:"Loaded"
npx mcporter call playwright.browser_wait_for time:2
```

### Click (use ref from snapshot)
```bash
npx mcporter call playwright.browser_click ref:"e123" element:"Submit button"
```

### Type into field
```bash
npx mcporter call playwright.browser_type ref:"e45" text:"search query" submit:true
```

### Run arbitrary Playwright code
```bash
npx mcporter call playwright.browser_run_code \
  code:"async (page) => { return await page.title(); }"
```

### Evaluate JS in page context
```bash
npx mcporter call playwright.browser_evaluate \
  function:"() => Array.from(document.querySelectorAll('table tr')).map(r => r.innerText)"
```

## Common Patterns

### Scrape table data
```bash
npx mcporter call playwright.browser_navigate url:"https://site.com/data"
npx mcporter call playwright.browser_wait_for time:2
npx mcporter call playwright.browser_snapshot filename:"raw.md"
```

### Login then scrape
```bash
npx mcporter call playwright.browser_navigate url:"https://site.com/login"
npx mcporter call playwright.browser_snapshot
# use refs from snapshot for fields
npx mcporter call playwright.browser_type ref:"REF" text:"user@email.com"
npx mcporter call playwright.browser_type ref:"REF" text:"password" submit:true
npx mcporter call playwright.browser_wait_for text:"Dashboard"
```

### Tab management
```bash
npx mcporter call playwright.browser_tabs action:list
npx mcporter call playwright.browser_tabs action:new
npx mcporter call playwright.browser_tabs action:select index:0
```

### Network inspection
```bash
npx mcporter call playwright.browser_network_requests includeStatic:false
```

## Tool Reference (22 tools)

| Tool | Purpose |
|---|---|
| `browser_navigate` | Go to URL |
| `browser_snapshot` | Accessibility tree (use for data extraction) |
| `browser_take_screenshot` | Visual screenshot |
| `browser_click` | Click element by ref |
| `browser_type` | Type text into element |
| `browser_fill_form` | Fill multiple fields at once |
| `browser_select_option` | Select dropdown option |
| `browser_hover` | Hover over element |
| `browser_drag` | Drag and drop |
| `browser_evaluate` | Run JS in page context |
| `browser_run_code` | Run Playwright code snippet |
| `browser_press_key` | Press keyboard key |
| `browser_wait_for` | Wait for text/element/time |
| `browser_navigate_back` | Browser back |
| `browser_tabs` | List/create/close/select tabs |
| `browser_network_requests` | Inspect network traffic |
| `browser_console_messages` | Get console output |
| `browser_handle_dialog` | Accept/dismiss dialogs |
| `browser_file_upload` | Upload files |
| `browser_resize` | Resize browser window |
| `browser_install` | Install browser (if missing error) |
| `browser_close` | Close browser |

## When to Use

- Frontend UI testing (visible browser by default — no extra config needed)
- Pages requiring JavaScript rendering / SPAs
- Extracting tables/prices from web pages
- Automated form submission and interaction flows
- Screenshots of web pages

## Anti-Patterns

❌ Don't call `browser_snapshot` without `filename:` when output is large — floods context
❌ Don't load playwright MCP in `.claude.json` alongside this skill — mcporter only
❌ Don't add `--headless` to mcporter.json for UI testing — defeats the purpose

Files in this skill

  • .mcp.json156 B
  • INSTALL.md1.9 KB
  • SKILL.md4.2 KB
  • barchart-tables.md2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.