Skip to content

Browser Automation

Astonish includes 34 browser automation tools for full web interaction, testing, and data extraction.

Configuration

yaml
browser:
  headless: true
  stealth: true
  timeout: 30
  viewport_width: 1920
  viewport_height: 1080

Configure browser settings via astonish config edit or Studio Settings.

Tools

ToolDescription
browser_navigateGo to a URL
browser_navigate_backNavigate back

Interaction

ToolDescription
browser_clickClick an element (animate_cursor=true moves the demo cursor first)
browser_typeType text into an input
browser_hoverHover over an element
browser_dragDrag and drop
browser_press_keyPress a keyboard key
browser_select_optionSelect a dropdown option
browser_fill_formFill multiple form fields at once
browser_highlightDraw a visible highlight overlay (ref or CSS selector)
browser_clear_highlightsRemove highlight overlays
browser_move_cursorMove the visible demo cursor to a ref, selector, or x/y
browser_file_uploadUpload a file to an input
browser_handle_dialogAccept/dismiss browser dialogs

Observation

ToolDescription
browser_snapshotGet page accessibility snapshot (structured content)
browser_take_screenshotCapture page screenshot
browser_console_messagesRead browser console output
browser_network_requestsView network request log
browser_response_bodyGet response body for a network request
browser_evaluateExecute JavaScript in page context
browser_run_codeRun JavaScript with return value

Tab & Window Management

ToolDescription
browser_tabsList all open tabs
browser_closeClose browser or tab
browser_resizeResize browser viewport
browser_fullscreenEnter/exit Chromium window fullscreen (recording prep)
browser_wait_forWait for a selector or condition
browser_pdfSave page as PDF

Cookies & Storage

ToolDescription
browser_cookiesGet/set cookies
browser_storageAccess localStorage/sessionStorage

Environment Configuration

ToolDescription
browser_set_offlineSimulate offline mode
browser_set_headersSet custom request headers
browser_set_credentialsSet HTTP Basic Auth credentials
browser_set_geolocationOverride geolocation
browser_set_mediaSet media features (dark mode, etc.)
browser_set_timezoneOverride timezone
browser_set_localeOverride locale
browser_set_deviceEmulate a device (iPhone, iPad, etc.)

Human Interaction

ToolDescription
browser_request_humanRequest human intervention for CAPTCHAs, etc.

Session Recording

ToolDescription
browser_start_recordingStart recording the browser display to an MP4 (ffmpeg x11grab); returns path + capture width/height
browser_stop_recordingStop recording and finalize the MP4 (emitted as a session artifact)
browser_recording_statusCheck whether a recording is in progress

Recording captures the live X display (probed via xdpyinfo). KasmVNC is locked against client resize with desktop.resolution set to the configured viewport (default 1920×1080) so Studio’s VNC view cannot shrink the framebuffer. Call browser_start_recording before a scripted demo, then browser_stop_recording when finished. Local mode needs ffmpeg + xdpyinfo; sandboxes install ffmpeg as a core tool and x11-utils with the browser stack.

Example Workflow

1. browser_navigate: "https://app.example.com/login"
2. browser_type: selector="#email", text="user@example.com"
3. browser_type: selector="#password", text="***"  (from resolve_credential)
4. browser_click: selector="button[type=submit]"
5. browser_wait_for: selector=".dashboard"
6. browser_take_screenshot
7. browser_close

Recording example

1. browser_navigate: "https://portal.example.com"   # warm-up first (avoid blank-tab capture)
2. browser_fullscreen: enabled=true
3. browser_start_recording: filename="portal-demo.mp4"
4. browser_highlight: ref=…, label="Dashboard"
5. browser_click: ref=…, animate_cursor=true
6. browser_stop_recording

For tutorial drills, run_drill starts each record: segment before the step tool — keep open/fullscreen steps without narration/record.

Stealth Mode

When stealth: true, the browser applies anti-detection techniques to avoid bot detection.

See Web & HTTP Tools for simpler page fetching and Credentials for secure password handling in automation.