docs/src/app/recording/page.mdx
Use record to capture browser automation as a WebM video for debugging, CI evidence, product walkthroughs, or repro reports.
agent-browser open https://example.com
agent-browser record start ./demo.webm
agent-browser snapshot -i
agent-browser click @e1
agent-browser record stop
After launching a session, record start can also navigate immediately:
agent-browser open
agent-browser record start ./demo.webm https://example.com
If no URL is provided, recording starts from the current page. The recording context copies cookies from the active session.
#!/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 "[email protected]"
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.
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 stop
Screenshots and videos work well together: screenshots capture precise still states, while the video shows timing, transitions, and unexpected overlays.
record stop before closing a session if you need the file flushed.