robotframework-browser

repository·main·Indexed 20 days ago

https://github.com/marketsquare/robotframework-browser

A Robot Framework library powered by Playwright for high-speed, reliable, and visible browser automation. It includes support for plugins to extend keywords, a Docker image for headful testing, and the robotframework-browser-batteries package to simplify installation by bundling a NodeJS 24 runtime.

Tokens
30.2K
Snippets
113
Records
249
Agent score
70%

What's inside robotframework-browser

  1. New features and enhancements in Browser 18.0.0

    main

    Browser version 18.0.0 introduced several significant improvements, including:

    • Browser Server Management: New keyword and CLI option to launch a Playwright BrowserServer (#3264).
    • Connection Capabilities: Added Attach to Running Browser to extend Connect To Browser functionality (#2676).
    • Improved Navigation: The Go To keyword now returns the HTTP status code (#395) and supports the waitUntil argument (#1811).
    • Enhanced Downloads:
      • Promise To Wait For Download now accepts a custom timeout argument (#1098).
      • The Download keyword includes a saveAs argument for better file handling (#1734).
      • Support for triggering multiple simultaneous downloads without waiting for them to finish (#3231).
    • Assertion Customization:
      • Set Assertion Formatters now supports a scope (#2571).
      • Support for custom formatters using lambda functions (#3230).
    • Lifecycle & Context:
      • New Page and New Persistent Context now support the waitUntil argument (#1811).
      • Automatic closing level MANUAL allows keeping the browser open after test termination (#1263).
    • Compatibility: Full support for Robot Framework 7.0 and its return types (#3254).
  2. Browser library 1.7.0: Key fixes and enhancements

    main

    Version 1.7.0 introduced several important changes to keyword behavior:

    • New Page Creation: When creating a new page, the library now respects the timeout value (previously it defaulted to a 10-second timeout regardless of settings).
    • Go To Keyword: Added support for a timeout argument to the Go To keyword.
    • Wait For Request/Response: Fixed issues where response matchers were not working and corrected the timeout unit documentation.
    • Error Handling: Improved the exception raised when attempting to click an element that is not clickable.
  3. New features in Browser library 2.2.0

    main

    Version 2.2.0 introduced several improvements:

    • gRPC Exception Truncation: Long error messages generated on the Node.js side are now truncated to 5,000 characters to prevent gRPC overflows that could hide the original error.
    • Assertion Engine Improvements: Enhanced error messages and documentation for the assertion engine to help users distinguish between different error types.
    • System Browser Workflow: Improvements to the workflow when using system browsers.
    • Playwright Update: Bumped internal Playwright version to 1.6.2.
    • Browser Path Configuration: Added options to specify a custom browser path at import time and an option to skip installing Playwright-bundled browsers.
  4. New features in Browser library v17.0.0

    main

    Version 17.0.0 introduced several key enhancements:

    • Playwright getBy locators: Support for Playwright's getBy locator strategies.
    • Multiple JS-Plugins: Added support for using multiple JavaScript plugins.
    • Click With Options: Introduced Click With Options to replace deprecated modifier patterns.
    • Cross-origin Storage: SessionStorage and LocalStorage keywords now support frames from different origins.
    • Frame-Selector: Fixed an issue where Frame-Selector >>> did not work with element=xxx selectors.
  5. Use Robot Framework 7.4 Secret type in Browser library

    main

    Browser library 19.14.0 supports the Secret type introduced in Robot Framework 7.4. This allows you to handle sensitive data securely in the following areas:

    • Arguments: The Proxy and httpCredentials arguments now support Secret types.
    • Keywords: The Type Secret and Fill Secret keywords support Secret type arguments.

    Note: Using Secret types requires Robot Framework 7.4 or higher. If you do not need Secret type support, the minimum required version of Robot Framework remains unchanged.

  6. Understand lazy initialization of Playwright

    main

    The Browser library now uses lazy initialization for the Playwright process. Previously, Playwright started immediately upon importing the library or using libdoc. Now, the Playwright process starts only when the first keyword is called or when extensions are used.

    Implications:

    • Your editor (e.g., RobotCode) may no longer show an error if rfbrowser init has not been executed, as the library can be imported without triggering the Playwright dependency check.
    • Errors related to missing initialization will be postponed until the first keyword execution.
  7. How the RF listener is implemented and used

    main

    The Robot Framework listener used to ship lifecycle context (suite/test start/end) to the test application is implemented as a library-as-listener. Instead of being passed as a standalone --listener flag on the command line, it is imported directly within the test suite configuration using the @library decorator with the listener='SELF' option.

    This approach ensures that the listener is automatically active in all suites where the library is imported, without requiring manual flag management for robot, pabot, or custom task runners.

    Note: When using this pattern, Robot Framework may emit a warning: Imported library has no keywords. This is expected behavior because @library(listener='SELF') disables auto-keyword discovery and the library contains no public keywords, only listener methods. This warning can be safely ignored.

    *** Settings ***
    Library    atest/test/__init__.robot    scope=GLOBAL    listener=SELF