| name | browser-testing |
| description | Full browser automation via Agent Browser Protocol (ABP). Navigate, click, type, scroll, drag, screenshot, extract text, handle dialogs/downloads/file pickers, manage tabs, control JS execution. Single CLI tool. |
Browser Automation — ABP
Single tool: {baseDir}/browser.js <command> [args] [--flags]
ABP is a Chromium fork with a REST API baked into the engine. Every action is deterministic — JS freezes between steps, no race conditions, no manual waits.
Setup
{baseDir}/browser.js start
Core Commands
B={baseDir}/browser.js
$B nav https://example.com
$B nav https://other.com --new
$B back
$B forward
$B reload
$B click 450 320
$B click 450 320 --right
$B click 450 320 --double
$B click 450 320 --mod CTRL
$B hover 300 200
$B scroll 640 400 --dy 500
$B scroll 640 400 --dy -300
$B scroll 640 400 --dx 200
$B drag 100 200 500 200
$B drag 100 200 500 200 --steps 20
$B type hello world
$B key ENTER
$B key TAB
$B key ESCAPE
$B key a --mod CTRL
$B key c --mod CTRL
$B key ARROWDOWN
$B key BACKSPACE
$B key a --mod CTRL --action down
$B key a --action up
$B slider 400 300 75
$B clear 400 300
$B pick "Select the login button"
$B screenshot
$B screenshot --markup clickable
$B screenshot --markup typeable
$B screenshot --markup clickable,typeable,scrollable,grid
$B screenshot --markup none
$B screenshot --format png
$B text
$B text "h1.title"
$B eval 'document.title'
$B eval '({links: document.querySelectorAll("a").length})'
$B content
$B content https://example.com
$B cookies
Tabs
$B tabs
$B tabs new https://google.com
$B tabs activate <id>
$B tabs close <id>
$B tabs info <id>
$B tabs stop <id>
Browser Events
ABP surfaces events that normally require polling — dialogs, file pickers, downloads, select dropdowns, permission prompts. They appear in the output of any action.
$B dialog
$B dialog accept
$B dialog accept "response text"
$B dialog dismiss
$B download
$B download status <id>
$B download cancel <id>
$B download get <id>
$B file <chooser_id> /path/to/file.pdf
$B file <chooser_id> file1.jpg file2.jpg
$B file <chooser_id> --cancel
$B file <chooser_id> --save /path/out.pdf
$B select <select_id> 2
$B permission
$B permission grant <id>
$B permission grant <id> --lat 42.36 --lng -71.06
$B permission deny <id>
Execution Control
ABP freezes JS between actions by default. You can control this:
$B execution
$B execution pause
$B execution resume
Advanced
$B batch '[{"type":"mouse_click","x":350,"y":200},{"type":"keyboard_type","text":"hello"},{"type":"keyboard_press","key":"ENTER"}]'
$B history
$B history current
$B history actions
$B history clear
$B status
$B shutdown
Global Flags
| Flag | Description |
|---|
--tab <id> | Target specific tab (default: active) |
--shot | Save screenshot after action (prints path) |
--markup <types> | Screenshot markup: interactive, clickable,typeable,scrollable,grid,selected, or none |
--format <fmt> | Screenshot format: webp (default), png, jpeg |
--json | Output raw API response as JSON |
Event Indicators
When events occur during any action, they're printed automatically:
→ https://new-page.com # Navigation happened
⚠ dialog (confirm): Delete item? # Dialog appeared
📁 file chooser id=fc_1 # File picker opened
⬇ download: report.pdf # Download started
▾ select id=s_1 (5 options) # Native select opened
🔐 permission id=p_1 geolocation # Permission requested
↗ popup: https://popup.com # Popup window
Speed Rules
The fast pattern: navigate → eval to extract. Skip screenshots unless you're lost.
- Start ABP first:
browser.js start
- Don't screenshot every step: Skip
--shot during form-filling. Only screenshot when you need to see layout.
- Observe the URL after search: Most SPAs encode filters in URL params. Copy it, modify it,
nav directly next time — skip the form entirely.
- Extract data via
eval, not vision: One JS query extracts 10 results faster than scrolling + screenshotting.
- Batch related inputs: Click + type + Enter = one
batch call instead of three.
- Use
text for simple data: text is faster than eval for plain text extraction.
- Use pick for ambiguity: When coordinates are unclear, let the user click.
Anti-pattern: click → screenshot → read image → decide → click → screenshot → ... (each step: ~3s for screenshot + LLM vision round-trip)
Fast pattern: nav → click click click (no shots) → eval to extract all data → screenshot once to verify