Loading...
Loading...
Browser automation using Playwright MCP for web testing, UI verification, and form automation. Use when navigating websites, clicking elements, filling forms, taking screenshots, or testing web applications. Supports iframe operations and complex JavaScript execution.
npx skill4agent add aktsmm/agent-skills browser-max-automation| 選択肢 | 説明 |
|---|---|
| Edge | Windows標準、企業環境向け |
| Chrome | 汎用、拡張機能が豊富 |
| モード | 説明 | メリット | デメリット |
|---|---|---|---|
| 新規ブラウザ | Playwrightが新しいブラウザを起動 | 設定が簡単、安定 | 別ウィンドウが開く |
| 既存ブラウザ (CDP) | 今開いているブラウザを操作 | 普段のブラウザをそのまま使える | 事前にデバッグモード起動が必要 |
mcp.json{
"servers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest", "--browser", "msedge"],
"type": "stdio"
}
}
}の値:--browser(Edge) /msedge(Chrome) /chrome(Firefox)firefox
# Edge の場合
Start-Process "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" -ArgumentList "--remote-debugging-port=9222"
# Chrome の場合
Start-Process "C:\Program Files\Google\Chrome\Application\chrome.exe" -ArgumentList "--remote-debugging-port=9222"{
"servers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest", "--cdp-endpoint", "http://localhost:9222"],
"type": "stdio"
}
}
}Ctrl+Shift+PDeveloper: Reload Windowmsedge.exe --remote-debugging-port=9222http://localhost:9222/json/version| Command | Purpose |
|---|---|
| Open URL |
| Get element refs (accessibility tree) |
| Click element by ref |
| Input text |
| Capture screen |
| Wait for text/time |
| Execute JavaScript |
1. browser_navigate(url)
2. browser_snapshot → get ref
3. browser_click/type(ref)
4. browser_snapshot → verifyasync (page) => {
const frame1 = page.locator('iframe[name="Content"]').contentFrame();
const frame2 = frame1.locator('iframe[title="Player"]').contentFrame();
await frame2.getByRole("radio", { name: "Option A" }).click({ force: true });
return "Selected";
};await element.click({ force: true });browser_snapshot → get ref → browser_click(ref)mcp.json| Type | Use Case | Selection |
|---|---|---|
| Single choice | One only |
| Multiple choice | 0 to many |