Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:MarketSquare Robotframework browser Browser Binary Installation

From Leeroopedia
Knowledge Sources
Domains Browser_Automation, Installation
Last Updated 2026-02-12 04:00 GMT

Overview

Installing browser binaries independently from the Node.js dependency setup allows selective download of specific browser engines and is the primary post-install step when using bundled binary distributions.

Description

The robotframework-browser library provides a dedicated rfbrowser install command that handles browser binary installation as a standalone operation, separate from the full rfbrowser init workflow. This separation is particularly important for the BrowserBatteries installation path, where the Node.js dependencies are already bundled into the prebuilt binary and only the Playwright browser engines need to be downloaded.

Supported Browsers:

The InstallableBrowser enum defines the following browser targets:

Browser Description
chromium Open-source Chromium browser engine
firefox Mozilla Firefox browser engine
webkit Apple WebKit browser engine
chromium-headless-shell Headless-only Chromium shell (lighter weight)
chromium-tip-of-tree-headless-shell Bleeding-edge Chromium headless shell
chrome Google Chrome stable channel
chrome-beta Google Chrome beta channel
msedge Microsoft Edge stable channel
msedge-beta Microsoft Edge beta channel
msedge-dev Microsoft Edge dev channel

Installation Options:

The InstallationOptions enum provides fine-grained control over the installation behavior:

Option CLI Flag Description
with-deps --with-deps Install system dependencies for browsers (fonts, shared libraries)
dry-run --dry-run Print what would be installed without actually downloading
list --list List all browsers from all Playwright installations on the system
force --force Force reinstall of stable browser channels even if already present
only-shell --only-shell Only install headless shell when installing chromium
no-shell --no-shell Do not install chromium headless shell

PLAYWRIGHT_BROWSERS_PATH Handling:

Before executing the install command, the function calls ensure_playwright_browsers_path(). If the PLAYWRIGHT_BROWSERS_PATH environment variable is not set, it is automatically configured to point to the default location: Browser/wrapper/node_modules/playwright-core/.local-browsers/.

Usage

Use rfbrowser install in the following scenarios:

  • With BrowserBatteries: After pip install robotframework-browser[bb], run rfbrowser install to download browser binaries without needing rfbrowser init
  • Selective browser installation: rfbrowser install chromium to download only Chromium
  • CI/CD environments: Use rfbrowser install --with-deps chromium to install system dependencies automatically
  • Auditing installed browsers: rfbrowser install --list to see what is currently installed
  • Dry run verification: rfbrowser install --dry-run to preview what would be downloaded

Theoretical Basis

The browser installation logic follows this pattern:

FUNCTION rfbrowser_install(browser, flags):
    1. Ensure PLAYWRIGHT_BROWSERS_PATH is set
       IF not set:
         Resolve default path: node_modules/playwright-core/.local-browsers/
         Set PLAYWRIGHT_BROWSERS_PATH to that resolved path
    2. Get a configured Browser library instance
    3. Build options list from enabled flags:
       FOR each flag in [with-deps, dry-run, list, force, only-shell, no-shell]:
         IF flag is enabled:
           Add corresponding CLI flag to options (e.g., "--with-deps")
    4. IF a specific browser was requested:
         Add browser name to options
    5. Execute: browser_lib.execute_npx_playwright("install", *options)
       This internally runs: npx playwright install [options]

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment