Troubleshooting & Local Data
Most failures can be diagnosed immediately from the returned error message and its attached errorShot screenshot. For workflow runs, open the Runs view to inspect the stopping node, outputs and HAR capture.
1. Locators & Page Scripts
"Matched N elements"
page_click, page_type and page_select require exactly one match so BrowserPilot never clicks the wrong button silently.
- Call
page_queryfirst to inspect each candidate'sindex, visible text and boundingrect. - Narrow the target with
within(supports:has-text("...")), passindex(0-based), or target byrole+name/label.
Timeouts, Shadow DOM & Cross-Origin iframes
- Pass
pierce: trueto search open Shadow DOM and same-origin iframes, with automatic fallback to cross-origin iframes (OOPIFs). - To target a specific cross-origin iframe directly, pass
frame(a URL substring of that<iframe>) or usepage.frameLocator(...)in the SDKs. - If an element is covered by a sticky header or modal ad, run
page_overlay { "action": "dismiss" }orpage_scrollfirst.
page_script Syntax Errors
page_script evaluates a JavaScript expression, not a bare function body:
- Invalid:
return { title: document.title } - Valid:
(() => ({ title: document.title }))()
(Inside a visual Workflow "Page Script" node, code is wrapped in an async function automatically so return works directly.)
2. MCP, SDK & CLI Connectivity
Why does my agent only see 13 tools?
BrowserPilot defaults to on-demand (search) mode so 105 schemas do not bloat your model's context window. Have the agent call search_tools (e.g. {"query": "cookie"} or {"query": "captcha"}) to fetch any tool and its schema, or switch Settings → General → Tool list to Full.
401 Unauthorized or Connection Refused
- Confirm BrowserPilot is running and Settings → General → MCP is enabled.
- Read the current
url,apiandtokenfrommcp.json:- Windows:
%APPDATA%\BrowserPilot\mcp.json - macOS:
~/Library/Application Support/BrowserPilot/mcp.json - Linux:
~/.config/BrowserPilot/mcp.json
- Windows:
- Ensure
127.0.0.1bypasses any system HTTP proxy (the official CLI and SDKs bypass loopback proxies automatically).
Non-ASCII Arguments in CLI
Always place non-ASCII or nested JSON arguments in a UTF-8 file and invoke browserpilot call <tool> --json-file args.json instead of inline shell quoting.
3. Streaming Media & Captchas
- Video downloads (
page_save_media): DASH two-track merges (Bilibili, Douyin, YouTube) andm3u8streams automatically downloadffmpegintotools/on first use. When encrypted worker streams cannot be extracted, fall back topage_record_video. - Captchas: Geetest v4 sliders are handled automatically by
captcha_solve(cv → ddddocr → onnx). Usecaptcha_readfor alphanumeric OCR (requires local Python +ddddocr),captcha_panelfor vision-agent coordinate solving, orpage_handofffor human verification.
4. Where Local Data Lives
All state stays inside your OS user data folder (%APPDATA%\BrowserPilot on Windows, ~/Library/Application Support/BrowserPilot on macOS, ~/.config/BrowserPilot on Linux):
| Data | Relative Path |
|---|---|
| MCP / API endpoint & token | mcp.json |
| Environments, tab groups, settings | envs.json, groups.json, settings.json |
| Workflows & run records | workflows/, runs.json, runs/ (error shots & HAR) |
| Per-environment SQLite history & proxy config | profiles/<env-id>/browserpilot/ (history.db, network.json) |
| Per-environment Chromium cookie partition | Partitions/<env-id>/ |
| Viewport screenshots & CSV exports | screenshots/, exports/ |
| Managed ffmpeg binary | tools/ |
| Page downloads, saved media & recordings | System Downloads folder by default (configurable in Settings) |
Copy the entire folder to back up your environments and workflows. Note that files produced by env_export contain plain-text cookies — keep them strictly local.