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.

Environment:MarketSquare Robotframework browser Node Runtime

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

Overview

Node.js 20+ runtime environment with Playwright, gRPC server, and browser binaries for the robotframework-browser backend process.

Description

This environment defines the Node.js runtime and all npm dependencies required to run the Playwright gRPC wrapper server. The server communicates with the Python side via gRPC and drives browser automation through Playwright. Node.js is required unless the BrowserBatteries package is installed, which bundles pre-built binaries. Playwright browser binaries (Chromium, Firefox, WebKit) must also be installed.

Usage

Use this environment whenever running Browser library tests or developing the Node.js wrapper. It is required for all browser interactions. If BrowserBatteries is installed, Node.js is not needed on the host machine.

System Requirements

Category Requirement Notes
OS Linux, macOS, or Windows Playwright supports all three platforms
Node.js 20.x, 22.x, or 24.x Tested versions in CI
Disk ~500MB for node_modules Plus ~700MB per browser binary

Dependencies

System Packages

  • Node.js >= 20.x
  • `npm` (bundled with Node.js)
  • Playwright system dependencies (installed via `npx playwright install-deps`)

Node.js Packages (Runtime)

  • `@grpc/grpc-js` ^1.14.3
  • `@medv/finder` ^4.0.2
  • `google-protobuf` 4.0.1
  • `monocart-coverage-reports` ^2.12.9
  • `pino` ^10.3.1
  • `playwright` ^1.58.2
  • `strip-comments` ^2.0.1
  • `uuid` ^13.0.0

Playwright Browser Binaries

Supported browsers for installation:

  • `chromium`
  • `chromium-headless-shell`
  • `firefox`
  • `webkit`
  • `chrome`
  • `chrome-beta`
  • `msedge`
  • `msedge-beta`
  • `msedge-dev`
  • `bidi-chromium`

Credentials

The following environment variables control Node.js and Playwright behavior:

  • `ROBOT_FRAMEWORK_BROWSER_NODE_PORT` — Connect to an existing Playwright process on this port instead of spawning a new one.
  • `ROBOT_FRAMEWORK_BROWSER_NODE_DEBUG_OPTIONS` — Comma-separated Node.js debug options (e.g., `--inspect`).
  • `ROBOT_FRAMEWORK_BROWSER_PINO_LOG_LEVEL` — Log level for the pino logger in the Node.js process.
  • `ROBOT_FRAMEWORK_BROWSER_TRACING` — Enable Playwright tracing via environment variable.
  • `PLAYWRIGHT_BROWSERS_PATH` — Custom path for storing Playwright browser binaries. Set to `"0"` to use the default location.
  • `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` — Skip browser binary download during `rfbrowser init`.
  • `DEBUG` — Set to `"pw:api"` to enable Playwright API debug logging.

Quick Install

# After pip install robotframework-browser, initialize Node dependencies:
rfbrowser init

# Install specific browsers only:
rfbrowser install chromium
rfbrowser install firefox webkit

# Skip browser download (use system-installed browsers):
rfbrowser init --skip-browsers

Code Evidence

Node.js availability check from `Browser/playwright.py:99-106`:

try:
    run(["node", "-v"], stdout=DEVNULL, check=True)
except (CalledProcessError, FileNotFoundError, PermissionError) as err:
    raise RuntimeError(
        "Couldn't execute node. Please ensure you have node.js installed and in PATH. "
        "See https://nodejs.org/ for instructions. "
        f"Original error is {err}"
    )

Node modules existence check from `Browser/playwright.py:110-126`:

project_folder = self._rfbrowser_dir.parent
if any(
    [
        (project_folder / "node_modules").is_dir(),
        (self._browser_wrapper_dir / "node_modules").is_dir(),
    ]
):
    return

raise RuntimeError(
    "\n#############################################################"
    "\n#  RF-Browser dependencies not found in installation path!  #"
    "\n#           Run `rfbrowser init` to install.                #"
    "\n#############################################################"
)

Environment variable port detection from `Browser/playwright.py:136-150`:

env_node_port = os.environ.get("ROBOT_FRAMEWORK_BROWSER_NODE_PORT")
existing_port = self.port or env_node_port
if existing_port is not None:
    self.port = existing_port

Common Errors

Error Message Cause Solution
`Couldn't execute node. Please ensure you have node.js installed and in PATH.` Node.js not installed or not in PATH Install Node.js 20+ from https://nodejs.org/
`RF-Browser dependencies not found in installation path!` `rfbrowser init` not run after pip install Run `rfbrowser init`
`Could not connect to the playwright process` Node.js gRPC server failed to start within 15 seconds Check `playwright-log.txt` for errors; ensure port is available
`browserType.launch: Executable doesn't exist` Browser binaries not installed Run `rfbrowser install chromium` or `rfbrowser init`

Compatibility Notes

  • BrowserBatteries alternative: When `robotframework-browser-batteries` is installed, Node.js is not required on the host. The batteries package bundles pre-compiled binaries.
  • Windows npm: On Windows, npm commands require `shell=True` due to PATH resolution differences. The library handles this automatically.
  • macOS Sonoma: A 1-second startup delay is added on macOS Darwin to prevent hanging processes. See the Heuristic:MarketSquare_Robotframework_browser_MacOS_Sonoma_Startup_Delay heuristic.

Related Pages

Page Connections

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