The only extension for seamless setup of Chrome for Testing (CfT) in and within Robot Framework.
For detailed information on CfT, refer to the official CfT documentation:
π© Before proceeding check out release checklist
This module provides a conveniet keyword that takes care of automated installation and configuration of specific Chromium flavour: Chrome for Testing. Dynamically ensures a consistent automation testing environment across multiple platforms, by encapsulation of automatic browser infrastructure setup.
pip install robotframework-chromefortesting
It is highly recommended to use a virtual environment (.venv) for achieving best reliability.
In your Robot Framework script:
*** Settings ***
Library ChromeForTesting
*** Test Cases ***
Open page
Open Chrome Browser https://en.wikipedia.org/wiki/Grapefruit
*** Keywords ***
Open Chrome Browser ${url}
# Create your own custom browser/page opener and adjust further if required
Initialise Chrome For Testing ${channel}=stable ${path}=None ${headless}=False
Open Browser ${url} browser=chrome
On Windows Chromedriver will attempt to access Google Chrome default binary install location C:\Program Files\Google\Chrome\Application\
uncoditionally.
Alas, such attempt of access takes precedence over system-wide %PATH%
executable path and any kind of virtual environment activation %PATH%
control.
Thus, to harden only CfT binary recognition, consider the following strategies based on your specific use case, context, workflow, or pipeline:
- Ditch Google Chrome -> OK for CI/CD agents & containers, humankind.
- π‘ Capture module keyword output & provide with
Open Browser
options:
*** Keywords ***
Open Chrome Browser ${url}
${binary_location} Initialise Chrome For Testing ${channel}=stable
${options} Set Variable add_argument("--binary-location=${binary_location}")
Open Browser ${url} chrome options=${options}
- Select
Beta
instead ofStable
channel (or any other). Version divergence against consumer release of Google Chrome will result in non-compatible binary bypass. -> OK for anticipatory automated testing, smart. - Rename default Google Chrome executable:
chrome.exe
->googlechrome.exe
-> OK, obscure.
- complete platform detection
- chrome binary return support
- headless chrome support
- explicit Robot Framework logging
- progress bar for downloads
- complete error handling