Tray icon and REPL for trying out Browser Library keywords using Chromium or Edge
Project description
robotframework-browser-tray
Tray icon and REPL for trying out Browser Library keywords using Chromium or Edge
Requirements
- NodeJS >= 18
- Windows
Use Cases
-
Execute tests incrementally using e.g. RobotCode
-
Test selectors in an open web page interactively
How to use it
- Install the package
pip install robotframework-browser-tray
- Execute
browser-tray
Hint: In case your environment does not allow executing browser-tray, call the Python module directly:
python -m BrowserTray
-
Click on the tray icon with the Chromium logo
-
Open a Terminal and execute
ibrowser
Hint: In case your environment does not allow executing ibrowser, call the Python module directly:
python -m BrowserTray.Repl
ibrowser
ibrowser allows testing selectors in an open web page interactively.
To start it execute:
ibrowser
On start up it checks whether the Chromium installed by rfbrowser init chromium
is present. It can also be used with Microsoft Edge. See the section below for instructions.
In addition to the selectors supported by Browser Library, ibrowser
adds the selector role
for selecting elements using their ARIA role.
The role of an element can be easily obtained from the Accessibility Tree. To open the tree follow these steps:
- Press F12 to open the DevTools
- Select the Elements tab
- In the right panel click on the Accessibility tab
- In the section "Accessibility Tree" check "Enable full-page accessibility tree"
- Click the button "Reload DevTools"
- In the left panel click on the person icon to toggle the Accessibility Tree view
Usage in a Robot Framework Test Suite
Add these lines to the Settings section of the .robot file:
Library Browser playwright_process_port=55555
Test Setup Connect To Browser http://localhost:1234 chromium use_cdp=True
In order to use other ports execute:
browser-tray --pw-port=XXXX --cdp-port=XXXX
Using Microsoft Edge
If Microsoft Edge is installed on your machine:
- Create a Shortcut to msedge.exe with the target:
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --remote-debugging-port=1234 --user-data-dir=C:\Users\YOUR_USER\RFEdgeProfile
-
Start Edge using this shortcut
-
Execute
ibrowser
How it works
On start up browser-tray
checks whether rfbrowser init
has been executed.
If this requirement is met the Playwright wrapper is started with node site-packages/Browser/wrapper/index.js 55555
.
Selecting "Open Chromium" in the tray icon executes site-packages/Browser/wrapper/node_modules/playwright-core/.local-browsers/chromium-XX/chrome-win/chrome.exe --remote-debugging-port=1234 --test-type
.
ibrowser
is a batteries-included irobot that saves time by importing Browser Library and connecting to a running Chromium or Edge.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for robotframework_browser_tray-1.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b20a9cb140438d12546aff766ae0dddf8a55bdcee625fe8f5d0d0a4b9801b823 |
|
MD5 | 11c99e8da3e5d1e39640aed57e18f42f |
|
BLAKE2b-256 | ea382d0a4b503294120fc4bfad25dab27ab3b42c62e92cabd72cbb6e84d40439 |
Hashes for robotframework_browser_tray-1.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e11894031711e167df2fabe12496749c89930e54d2b1f029f1d51bcf0c97b914 |
|
MD5 | 92a14c4321282be73cca539a88a14e22 |
|
BLAKE2b-256 | 8c6a280ec1022500cd375f77fbd16df31c2951cba5fd2694e7a2177f5af1b5a7 |