orhankalyon / robotframework-chromefortesting

Actually automated Chrome for Testing.

Home Page:https://pypi.org/project/robotframework-chromefortesting/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

robotframework-chromefortesting πŸ‡ΊπŸ‡¦

Version Made in Ukraine

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:

πŸ“– Overview

🎩 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.

πŸ“¦ Instalation

pip install robotframework-chromefortesting

It is highly recommended to use a virtual environment (.venv) for achieving best reliability.

πŸ”¨ Usage

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

⚠️ Oi, Windows!

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:

  1. Ditch Google Chrome -> OK for CI/CD agents & containers, humankind.
  2. πŸ’‘ 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}
  1. Select Beta instead of Stable 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.
  2. Rename default Google Chrome executable: chrome.exe -> googlechrome.exe -> OK, obscure.

πŸ“‹ Checklist

  • complete platform detection
  • chrome binary return support
  • headless chrome support
  • explicit Robot Framework logging
  • progress bar for downloads
  • complete error handling

About

Actually automated Chrome for Testing.

https://pypi.org/project/robotframework-chromefortesting/

License:GNU General Public License v3.0


Languages

Language:Python 100.0%