| name | browser-automation |
| description | This skill should be used when the user asks to "test in browser", "open a webpage", "take a screenshot", "fill a form", "E2E test", "verify in browser", "check the UI", "test the frontend", or needs to interact with a web application. Provides browser automation capabilities via the `agent-browser` CLI. |
Browser Automation Skill
Use agent-browser CLI for browser automation, E2E testing, and web interactions.
Quick Start
agent-browser open https://example.com
agent-browser screenshot /tmp/screenshot.png
agent-browser snapshot -i
Common Workflows
1. Test a signup/login form
agent-browser open https://app.example.com/signup
agent-browser snapshot -i
agent-browser fill @e1 "test@example.com"
agent-browser fill @e2 "password123"
agent-browser click @e3
agent-browser wait 2000
agent-browser screenshot /tmp/result.png
agent-browser get url
2. Verify page content
agent-browser open https://example.com
agent-browser snapshot
agent-browser get title
agent-browser get text @e1
3. Debug network requests
agent-browser open https://example.com
agent-browser eval "JSON.stringify(performance.getEntriesByType('resource').filter(r => r.name.includes('api')).map(r => ({name: r.name})))"
Element Selection
- Refs:
@e1, @e2 (from snapshot output)
- CSS:
#id, .class, button[type=submit]
- Text:
text=Login, text="Submit Form"
Key Commands
| Command | Description |
|---|
open <url> | Navigate to URL |
snapshot -i | Get interactive elements |
screenshot <path> | Capture screenshot |
fill <selector> <text> | Fill input field |
click <selector> | Click element |
wait <ms> | Wait milliseconds |
get url | Get current URL |
get title | Get page title |
eval <js> | Execute JavaScript |
Tips
- Always snapshot first before interacting with elements
- Use
-i flag to see only interactive elements
- Take screenshots to verify state after actions
- Element refs change after page updates - re-snapshot
- Use sessions for multi-step workflows:
agent-browser --session name open ...
When to Use
Use browser automation for:
- E2E testing signup/login flows
- Verifying UI changes
- Testing form submissions
- Checking page rendering
- Debugging frontend issues
Don't use when:
- Simple API test suffices (use curl)
- Checking static content (use WebFetch)