Principle:MarketSquare Robotframework browser Installation Path Selection
| Knowledge Sources | |
|---|---|
| Domains | Browser_Automation, Installation |
| Last Updated | 2026-02-12 04:00 GMT |
Overview
Selecting an installation path determines whether a browser automation framework bundles its runtime dependencies as prebuilt binaries or delegates dependency management to the user via system-level package managers.
Description
The robotframework-browser library offers two distinct installation paths that trade off convenience against control:
BrowserBatteries (Bundled Binaries): This approach packages a prebuilt gRPC server executable directly into the installable distribution. The prebuilt binary includes the Node.js runtime, the Playwright Node module, and the gRPC server code compiled into a single standalone executable. By eliminating the need for users to install and manage Node.js and npm on their systems, this path dramatically simplifies deployment in environments such as CI pipelines, Docker containers, and corporate workstations where installing system-level tools may be restricted or inconvenient.
When using BrowserBatteries, the PLAYWRIGHT_BROWSERS_PATH environment variable defaults to "0", which instructs Playwright to look for browser binaries relative to the package installation directory. Users still need to install Playwright browser binaries separately via the rfbrowser install command.
Standard Install (User-Managed NodeJS): This traditional approach requires the user to have Node.js and npm pre-installed on their system. After installing the Python package, the user runs rfbrowser init which executes npm ci --production to install the Node.js dependencies (including Playwright) from the package-lock.json file, and then optionally downloads browser binaries. This path gives users full control over the Node.js version and npm configuration, which can be important for organizations with strict dependency policies.
The key architectural difference is that BrowserBatteries replaces the standard Node.js-based gRPC server process with a native binary that communicates over the same gRPC protocol. From the Robot Framework test perspective, the behavior is identical regardless of which path is chosen.
Usage
Choose BrowserBatteries when:
- The target environment lacks Node.js or npm
- Simplicity and speed of setup are paramount
- Deploying in constrained environments (containers, CI, locked-down workstations)
- You want a single
pip installto handle all non-browser dependencies
Choose Standard Install when:
- You need precise control over the Node.js version or npm registry configuration
- Your organization requires auditing all transitive Node.js dependencies
- You are developing or extending the Browser library itself
- You need to use a custom or patched version of Playwright
Theoretical Basis
The decision logic for choosing an installation path can be expressed as:
IF user requires minimal setup AND no custom Node.js configuration needed:
Install BrowserBatteries package (pip install robotframework-browser[bb])
The prebuilt gRPC server binary is used at runtime
PLAYWRIGHT_BROWSERS_PATH defaults to "0" (package-relative)
Run: rfbrowser install (to download browser binaries only)
ELSE IF user needs full control over Node.js dependencies:
Install standard package (pip install robotframework-browser)
Ensure Node.js >= 18 and npm are available in PATH
Run: rfbrowser init (npm ci + optional browser download)
PLAYWRIGHT_BROWSERS_PATH defaults to "0" or user-defined path
IN BOTH CASES:
The gRPC server communicates identically with the Python side
Robot Framework keywords behave the same regardless of path