{"id":5460,"library":"robotframework-browser","title":"Robot Framework Browser library","description":"Robot Framework Browser library (robotframework-browser) is a web testing library for Robot Framework that uses Playwright internally for browser automation. It aims for speed, reliability, and visibility in web testing. The library has a rapid release cadence, frequently publishing hotfixes and minor versions, often on a monthly or bi-weekly basis.","status":"active","version":"19.14.2","language":"en","source_language":"en","source_url":"https://github.com/MarketSquare/robotframework-browser","tags":["robot framework","browser automation","playwright","web testing","qa","automation"],"install":[{"cmd":"pip install robotframework-browser\nrfbrowser init","lang":"bash","label":"Standard installation (requires Node.js)"},{"cmd":"pip install robotframework-browser[bb]\nrfbrowser install","lang":"bash","label":"Installation without Node.js using BrowserBatteries"}],"dependencies":[{"reason":"Required for Robot Framework and the library itself.","package":"python","version":">=3.10"},{"reason":"Required by Playwright, which is used internally by the library. LTS versions 20, 22, and 24 are supported.","package":"nodejs","version":"20/22/24 LTS","optional":true},{"reason":"The core framework for which this library provides web automation capabilities.","package":"robotframework","version":">=6.1"}],"imports":[{"note":"In Robot Framework test files, libraries are imported in the '*** Settings ***' section. Direct Python `import` statements for `Browser` are generally not used by end-users.","symbol":"Browser","correct":"*** Settings ***\nLibrary    Browser"}],"quickstart":{"code":"*** Settings ***\nLibrary    Browser\n\n*** Test Cases ***\nExample Test\n    New Page    https://playwright.dev\n    Get Text    h1    contains    Playwright","lang":"robotframework","description":"This quickstart demonstrates a basic Robot Framework test case using the Browser library. It opens a new browser page to playwright.dev and asserts that the `h1` element contains the text 'Playwright'."},"warnings":[{"fix":"Upgrade your Python environment to 3.10 or newer. Refer to the library's official documentation for current Python requirements.","message":"Python 3.8 support was dropped with version 18.9.0. Users on Python 3.8 or older must upgrade their Python environment to Python 3.9+ (or higher, as latest versions require 3.10+).","severity":"breaking","affected_versions":">=18.9.0"},{"fix":"Avoid importing internal utility modules. If specific boolean conversion logic is needed, implement it directly in your test suite or custom library based on Robot Framework's documented APIs.","message":"The `Browser/utils/robot_booleans.py` module was removed in version 19.14.0. If you were directly importing or referencing this internal module, your tests will break.","severity":"breaking","affected_versions":">=19.14.0"},{"fix":"Always execute `rfbrowser init` after installation or upgrade. If Node.js is not present, consider `pip install robotframework-browser[bb]` and then `rfbrowser install`.","message":"After `pip install robotframework-browser`, it is crucial to run `rfbrowser init` (or `python -m Browser.entry init`) to download necessary browser binaries and Node.js dependencies. Forgetting this step will lead to 'Couldn't execute node' or similar errors when tests run.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your Node.js and Python versions align with the library's requirements. If issues persist, try explicitly installing a known working `grpcio` version (e.g., `pip install grpcio==1.78.0`) or using the `robotframework-browser-batteries` variant to bypass Node.js entirely.","message":"The `grpcio` dependency, which is used for communication between Python and Node.js, has historically caused installation and runtime issues, especially on macOS (M1/ARM) or with specific Python versions (e.g., building wheels failing). Version 19.12.7 specifically downgraded `grpcio` to 1.78.0 to address issues.","severity":"gotcha","affected_versions":"All versions, particularly older ones or specific environments"},{"fix":"Familiarize yourself with the Browser library's concepts of Browser, Context, and Page. Review the official documentation and examples for recommended patterns, especially regarding session management and element interaction.","message":"The Browser library uses a different paradigm (Browser, Context, Page layers) compared to older Selenium-based libraries. Directly migrating tests from `SeleniumLibrary` without understanding these new concepts can be challenging and lead to incorrect or inefficient test implementations.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If you intend to interact with multiple elements, use keywords explicitly designed for that (e.g., `Get Elements`) or disable strict mode where appropriate. Be explicit with your selectors to target a single element.","message":"By default, the Browser library enables 'strict mode' for selectors, meaning keywords will fail if a selector matches multiple elements. This differs from some other web automation libraries.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If video playback is critical, try running tests with Firefox or Webkit, or specifically with a full Google Chrome or Microsoft Edge browser (instead of the default Chromium provided by Playwright).","message":"Playing videos in automated tests using Chromium can sometimes fail due to codec problems. This is often an upstream Playwright/Chromium limitation.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}