Browser Drivers
Configure browser automation drivers for QUESTPIE Probe — agent-browser or Playwright.
Browser Drivers
QUESTPIE Probe uses an adapter pattern for browser automation. Both drivers are installed automatically as peer dependencies.
agent-browser (Default)
agent-browser by Vercel Labs is a Rust-based CLI that runs a persistent browser daemon. Default driver, optimized for AI coding agents.
- Persistent daemon — browser stays open between CLI calls
- Session-based — cookies and localStorage persist across commands
- Accessibility snapshots — structured a11y trees instead of raw HTML (token-efficient)
- Ref-based targeting — elements identified by
@refnumbers from snapshots
qprobe browser open http://localhost:3000
qprobe browser snapshot # Returns a11y tree with @ref numbers
qprobe browser click @14 # Click element with ref 14
qprobe browser fill @7 "hello" # Fill input at ref 7Playwright
Playwright by Microsoft provides cross-browser automation and test execution. Used by qprobe replay to run recorded tests.
- Cross-browser — Chromium, Firefox, WebKit
- CSS selector targeting — standard selectors instead of refs
- Powers
qprobe replaytest execution - Install browsers after first install:
bunx playwright install
Configuration
Set the driver in qprobe.config.ts:
import { defineConfig } from '@questpie/probe'
export default defineConfig({
browser: {
driver: 'agent-browser', // 'agent-browser' | 'playwright'
baseUrl: 'http://localhost:3000',
headless: true,
session: 'qprobe',
},
})Or via environment variable:
QPROBE_BROWSER_DRIVER=playwright qprobe browser open http://localhost:3000Comparison
| Feature | agent-browser | Playwright |
|---|---|---|
| Install | npm i -g agent-browser | npm i -D @playwright/test |
| Browsers | Chromium | Chromium, Firefox, WebKit |
| Targeting | @ref numbers | CSS selectors |
| Persistence | Daemon (survives CLI calls) | Per-session |
| Snapshots | a11y tree (compact) | Full DOM |
| Token efficiency | High | Lower |
| Replay support | No | Yes |
| Peer dependency | Yes | Optional |