Video Recording#
Use record to capture browser automation as a WebM video for debugging, CI evidence, product walkthroughs, or repro reports.
Basic workflow#
agent-browser open https://example.com
agent-browser record start ./demo.webm
agent-browser snapshot -i
agent-browser click @e1
agent-browser record stopAfter launching a session, record start can also navigate immediately:
agent-browser open
agent-browser record start ./demo.webm https://example.comIf no URL is provided, recording starts from the current page. The recording context copies cookies from the active session.
Commands#
| Command | Description |
|---|---|
record start <path.webm> [url] | Start recording to a WebM file |
record stop | Stop the active recording and save the file |
record restart <path.webm> [url] | Stop the current recording and immediately start another |
CI evidence#
#!/bin/bash
set -e
cleanup() {
agent-browser record stop 2>/dev/null || true
agent-browser close 2>/dev/null || true
}
trap cleanup EXIT
agent-browser open https://app.example.com/login
agent-browser record start "./artifacts/login-flow.webm"
agent-browser snapshot -i
agent-browser fill @e1 "demo@example.com"
agent-browser fill @e2 "password"
agent-browser click @e3
agent-browser wait --url "**/dashboard"Keep recordings as CI artifacts when browser failures are hard to diagnose from text output alone.
Human-readable demos#
Add small waits when the video is meant for a person to watch:
agent-browser open https://shop.example.com
agent-browser record start ./checkout.webm
agent-browser wait 500
agent-browser click @e4
agent-browser wait 500
agent-browser screenshot ./screenshots/cart.png
agent-browser record stopScreenshots and videos work well together: screenshots capture precise still states, while the video shows timing, transitions, and unexpected overlays.
Output format#
| Property | Value |
|---|---|
| Container | WebM |
| Common extension | .webm |
| Viewport | Uses the active browser viewport settings |
| State | Copies cookies from the active session |
Limitations#
- Recording adds overhead to automation.
- Long recordings can use significant disk space.
- Use
record stopbefore closing a session if you need the file flushed. - Some constrained headless environments may have codec or GPU limitations.