Principle:MarketSquare Robotframework browser Browser Binary Installation
| 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], runrfbrowser installto download browser binaries without needingrfbrowser init - Selective browser installation:
rfbrowser install chromiumto download only Chromium - CI/CD environments: Use
rfbrowser install --with-deps chromiumto install system dependencies automatically - Auditing installed browsers:
rfbrowser install --listto see what is currently installed - Dry run verification:
rfbrowser install --dry-runto 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]