Socket
Book a DemoInstallSign in
Socket

robotframework-browser

Package Overview
Dependencies
Maintainers
5
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

robotframework-browser

Robot Framework Browser library powered by Playwright. Aiming for speed, reliability and visibility.

pipPyPI
Version
17.3.0
Maintainers
5

robotframework-browser

All Contributors

Version Actions Status License

Robot Framework Browser library powered by Playwright. Propelling browser automation into the future!

Aiming for :rocket: speed, :white_check_mark: reliability and :microscope: visibility.

See keyword documentation and web page for more details.

Installation instructions

For both installation options only Python 3.10 or newer is supported. There are two main ways to install Browser library, with or without user having NodeJS installed.

The easiest way to install the Browser library is to use the robotframework-browser-batteries package (BrowserBatteries). BrowserBatteries contains precompiled NodeJS binaries and NodeJS dependencies, so that users do not need to install NodeJS or its Node-side dependencies by them self.

Limitations:

  • BrowserBatteries may not be available for every operating system or processor architecture.
  • If you develop plugins that require third-party NodeJS modules, those modules are not compiled into the BrowserBatteries package.

See Installation without NodeJS for more details.

If BrowserBatteries package is not suitable for you, for some reason, then you need to install NodeJS, install robotframework-browser and install NodeJS dependencies. See more detail in Installation with NodeJS chapter

Installation without NodeJS

  • Update pip pip install -U pip to ensure latest version is used
  • Install robotframework-browser and robotframework-browser-batteries from the commandline: pip install robotframework-browser[bb]
  • Install the Playwright browser binaries, run: rfbrowser install
  • if rfbrowser is not found, try python -m Browser.entry install

Installation with NodeJS

From Node side 20, 22 and 24 LTS versions are supported.

  • Install NodeJS e.g. from https://nodejs.org/en/download/
  • Update pip pip install -U pip to ensure latest version is used
  • Install robotframework-browser from the commandline: pip install robotframework-browser
  • Install the node dependencies: run rfbrowser init in your shell
  • if rfbrowser is not found, try python -m Browser.entry init

Please note that by default Chromium, Firefox and WebKit browser are installed, even those would be already installed in the system. The installation size depends on the operating system, but usually is +700Mb. It is possible to skip browser binaries installation with rfbrowser install-browser --skip-browsers or rfbrowser init --skip-browsers command, but then user is responsible for Playwright browser binary installation. It is possible to install only selected browser binaries by adding chromium, firefox or webkit as arguments to init command. Example rfbrowser init firefox would install only Firefox binaries and rfbrowser install-browser firefox chromium would install both Firefox and Chromium binaries.

Or use the docker images . Documented at docker/README.md.

Install with transformer

Starting from release 19.11.0 Browser library has optional dependency with Robocop. Install library with Robocop, run install with: pip install robotframework-browser[robocop]. Starting from 18.3.0 release, library will provide external Robocop transformer. Transformer provided by Browser library can be run with command: rfbrowser transform --transformer-name /path/to/tests. Example: rfbrowser transform --wait-until-network-is-idle /path/to/tests would transform deprecated Wait Until Network Is Idle keyword to Wait For Load State keyword. To see full list of transformers provided by Browser library, run command: rfbrowser transform --help.

Update instructions without NodeJS

To upgrade your already installed robotframework-browser and robotframework-browser-batteries follow steps in below. Please note that robotframework-browser and robotframework-browser-batteries packages are tied together and having different versions of these packages is not supported.

  • Update from commandline: pip install -U robotframework-browser robotframework-browser-batteries
  • Clean old node side dependencies and browser binaries: rfbrowser clean-node
  • Install the node dependencies for the newly installed version: rfbrowser install

Update instructions with NodeJS

To upgrade your already installed robotframework-browser library

  • Update from commandline: pip install -U robotframework-browser
  • Clean old node side dependencies and browser binaries: rfbrowser clean-node
  • Install the node dependencies for the newly installed version: rfbrowser init

Uninstall instructions

To completely uninstall library, including the browser binaries installed by Playwright, run following commands:

  • Clean old node side dependencies and browser binaries: rfbrowser clean-node
  • Uninstall with pip: pip uninstall robotframework-browser
  • If you have BrowserBatteries installed, also run: pip uninstall robotframework-browser-batteries

Examples

Testing with Robot Framework

*** Settings ***
Library   Browser

*** Test Cases ***
Example Test
    New Page    https://playwright.dev
    Get Text    h1    contains    Playwright

and testing with Python.

import Browser
browser = Browser.Browser()
browser.new_page("https://playwright.dev")
assert 'Playwright' in browser.get_text("h1")
browser.close_browser()

and extending with JavaScript

async function myGoToKeyword(url, page, logger) {
    logger("Going to " + url)
    return await page.goto(url);
}
myGoToKeyword.rfdoc = "This is my own go to keyword";
exports.__esModule = true;
exports.myGoToKeyword = myGoToKeyword;
*** Settings ***
Library   Browser  jsextension=${CURDIR}/mymodule.js

*** Test Cases ***
Example Test
   New Page
   myGoToKeyword   https://www.robotframework.org

See example. Ready made extensions and a place to share your own at robotframework-browser-extensions.

Ergonomic selector syntax, supports chaining of text, css and xpath selectors

# Select element containing text "Login" with text selector strategy
# and select it's parent `input` element with xpath
Click    "Login" >> xpath=../input
# Select element with CSS strategy and select button in it with text strategy
Click    div.dialog >> "Ok"

Evaluate in browser page

New Page   ${LOGIN_URL}
${ref}=    Get Element    h1
Get Property    ${ref}    innerText    ==    Login Page
Evaluate JavaScript    ${ref}    (elem) => elem.innerText = "abc"
Get Property    ${ref}    innerText    ==    abc

Asynchronously waiting for HTTP requests and responses

# The button with id `delayed_request` fires a delayed request. We use a promise to capture it.
${promise}=    Promise To    Wait For Response    matcher=    timeout=3s
Click    \#delayed_request
${body}=    Wait For    ${promise}

Device Descriptors

${device}=  Get Device  iPhone X
New Context  &{device}
New Page
Get Viewport Size  # returns { "width": 375, "height": 812 }

Sending HTTP requests and parsing their responses

${response}=    HTTP    /api/post    POST    {"name": "John"}
Should Be Equal    ${response.status}    ${200}

Parallel test execution using Pabot

You can let RF Browser spawn separate processes for every pabot process. This is very simple, just run the tests normally using pabot (see https://github.com/mkorpela/pabot#basic-use ). However if you have small tests do not use --testlevelsplit, it will cause lots of overhead because tests cannot share the browsers in any case.

You can share the node side RF Browser processes by using the ROBOT_FRAMEWORK_BROWSER_NODE_PORT environment variable, and from Browser.utils import spawn_node_process helper (see the docs for the helper ). This saves some overhead based on how many splits of tests you are running. Clean up the process afterwards.

Re-using authentication credentials

Development

See CONTRIBUTING.md for development instructions.

Core team

In order of appearance.

  • Mikko Korpela
  • Tatu Aalto
  • Janne Hรคrkรถnen (Alumnus)
  • Kerkko Pelttari
  • Renรฉ Rohner

Contributors

This project is community driven and becomes a reality only through the work of all the people who contribute. Supported by Robocorp through Robot Framework Foundation.

Mikko Korpela
Mikko Korpela

๐Ÿ’ป
Tatu Aalto
Tatu Aalto

๐Ÿ’ป
Antti Karjalainen
Antti Karjalainen

๐Ÿ”
Ismo Aro
Ismo Aro

๐Ÿ”
Janne Hรคrkรถnen
Janne Hรคrkรถnen

๐Ÿ’ป
Kerkko Pelttari
Kerkko Pelttari

๐Ÿ’ป
Robocorp
Robocorp

๐Ÿ’ต
Renรฉ
Renรฉ

๐Ÿ’ป
Bryan Oakley
Bryan Oakley

๐Ÿค”
Tanakiat Srisaranyakul
Tanakiat Srisaranyakul

๐Ÿค”
Maaret Pyhรคjรคrvi
Maaret Pyhรคjรคrvi

๐Ÿ““
Karlo Smid
Karlo Smid

๐Ÿ““
Frank Schimmel
Frank Schimmel

๐Ÿ““
Christoph
Christoph

โš ๏ธ
Mika Hรคnninen
Mika Hรคnninen

๐Ÿ’ฌ
imbus
imbus

๐Ÿ’ต
Niklas
Niklas

๐Ÿ“–
gdroes
gdroes

โš ๏ธ
Reaktor
Reaktor

๐Ÿ’ต
Adrian Yorke
Adrian Yorke

๐Ÿ“– ๐Ÿ‘€
Nanakawa
Nanakawa

โš ๏ธ
Ed Manlove
Ed Manlove

๐Ÿ“– ๐Ÿ›
Brian Tsao
Brian Tsao

๐Ÿ› ๐Ÿ““
charis
charis

๐Ÿ’ป ๐Ÿ›
s-galante
s-galante

๐Ÿ›
Simon Meggle
Simon Meggle

๐Ÿ““ ๐Ÿ› โš ๏ธ ๐Ÿค”
Anna-Gunda
Anna-Gunda

๐Ÿ›
anton264
anton264

๐Ÿ““
emakaay
emakaay

๐Ÿ›
Nea Ohvo
Nea Ohvo

๐Ÿ›
Elout van Leeuwen
Elout van Leeuwen

๐Ÿ“– ๐Ÿค” ๐Ÿ’ป
LDerikx
LDerikx

๐Ÿ“–
olga-
olga-

๐Ÿ“– ๐Ÿ›
Nicholas Bollweg
Nicholas Bollweg

๐Ÿ“–
Ville Salonen
Ville Salonen

๐Ÿ›
Jani Mikkonen
Jani Mikkonen

๐Ÿ› ๐Ÿ“– ๐Ÿค” ๐Ÿ’ป
Aleh Borysiewicz
Aleh Borysiewicz

๐Ÿ›
Jรผrgen Knauth
Jรผrgen Knauth

๐Ÿ›
dalaakso
dalaakso

๐Ÿ›
msirkka
msirkka

๐Ÿค”
Ossi R.
Ossi R.

๐Ÿ’ป
Adrian V.
Adrian V.

๐Ÿ’ป ๐Ÿ› ๐Ÿค”
Sami Sallmรฉn
Sami Sallmรฉn

๐Ÿ› โš ๏ธ
Pekka Klรคrck
Pekka Klรคrck

๐Ÿ’ป ๐Ÿ›
Jani Palsamรคki
Jani Palsamรคki

๐Ÿ›
AllanMedeiros
AllanMedeiros

๐Ÿ›
Emmanuel Alap
Emmanuel Alap

๐Ÿ› ๐Ÿ’ป
ankurbhalla-gmail
ankurbhalla-gmail

๐Ÿค”
UliSei
UliSei

๐Ÿค” ๐Ÿ› ๐Ÿ’ป ๐Ÿ““
Tomasz Pawlak
Tomasz Pawlak

๐Ÿ›
mtoskamp
mtoskamp

๐Ÿ›
zastress
zastress

๐Ÿ›
Juga Paazmaya
Juga Paazmaya

๐Ÿ’ป
Raphael Smadja
Raphael Smadja

๐Ÿค” ๐Ÿ’ป ๐Ÿ›
Antti Pakkanen
Antti Pakkanen

๐Ÿ›
Luis A Gomez-Tinoco
Luis A Gomez-Tinoco

๐Ÿ› ๐Ÿ’ก ๐Ÿ’ป
ePlanLori
ePlanLori

๐Ÿ›
laguna357
laguna357

๐Ÿ›
Gavin Rodgers
Gavin Rodgers

๐Ÿ›
pokaalinkanssayohon
pokaalinkanssayohon

๐Ÿค”
Ryan Sandbach
Ryan Sandbach

๐Ÿ› ๐Ÿ’ป
Niko Kahilainen
Niko Kahilainen

๐Ÿ›
Guillaume Gautier
Guillaume Gautier

๐Ÿ“–
Robin Matz
Robin Matz

๐Ÿค”
Stavros Ntentos
Stavros Ntentos

๐Ÿ“–
Massukio
Massukio

๐Ÿ› ๐Ÿค”
Atihinen
Atihinen

๐Ÿ›
gvrkumar
gvrkumar

๐Ÿค”
Lauri Helkkula
Lauri Helkkula

๐Ÿ›
rlall07
rlall07

๐Ÿ› ๐Ÿค”
Eldad Uzman
Eldad Uzman

๐Ÿค”
mgarcibu
mgarcibu

๐Ÿ›
DominikG
DominikG

๐Ÿค”
jokinr
jokinr

โš ๏ธ ๐Ÿ›
Jier Chen
Jier Chen

๐Ÿ’ป
IDvoe
IDvoe

๐Ÿ›
Cosmin Poieana
Cosmin Poieana

๐Ÿ›
Shenthil
Shenthil

๐Ÿ›
Marduk Bolaรฑos
Marduk Bolaรฑos

๐Ÿ› ๐Ÿค”
amodzelewski
amodzelewski

๐Ÿ›
TimDicos
TimDicos

๐Ÿ›
vinismarques
vinismarques

๐Ÿ›
nizwiz
nizwiz

๐Ÿ›
Reddriver
Reddriver

๐Ÿค”
Seppo
Seppo

๐Ÿ›
rousku
rousku

๐Ÿ›
tomaspekarovic
tomaspekarovic

๐Ÿค”
Robin Mackaij
Robin Mackaij

๐Ÿ›
nixuewei
nixuewei

๐Ÿค”
Slava
Slava

๐Ÿค” ๐Ÿ› ๐Ÿ’ป
Kari Harju
Kari Harju

๐Ÿ›
you
you

๐Ÿ›
axiom41
axiom41

๐Ÿ›
amankul
amankul

๐Ÿ›
jcb-entrnce
jcb-entrnce

๐Ÿ›
Remppa
Remppa

๐Ÿ›
Tomasz Pawlak
Tomasz Pawlak

๐Ÿ›
Timo Stordell
Timo Stordell

๐Ÿ›
Marcin Gmurczyk
Marcin Gmurczyk

๐Ÿ’ป
Daniel Biehl
Daniel Biehl

๐Ÿ› ๐Ÿค”
rarajabs
rarajabs

๐Ÿ›
Sandeep Vaidya
Sandeep Vaidya

๐Ÿค”
falk
falk

๐Ÿ“–
ciadoh
ciadoh

๐Ÿ›
Johan van Iperen
Johan van Iperen

๐Ÿ’ป
Fabio Zadrozny
Fabio Zadrozny

๐Ÿ›
BCGST
BCGST

๐Ÿ“–
Wilfried van Asten
Wilfried van Asten

๐Ÿ› ๐Ÿ’ป
Mikal H Henriksen
Mikal H Henriksen

๐Ÿ›
alexinoDr
alexinoDr

๐Ÿ›
trybuskrzysztof
trybuskrzysztof

๐Ÿ›
Aino1980
Aino1980

๐Ÿ›
BjornAhmark
BjornAhmark

๐Ÿ›
Mezohren
Mezohren

๐Ÿ›
Zoupers Zou
Zoupers Zou

๐Ÿค”
lasselindqvist
lasselindqvist

๐Ÿ›
David Nieto Sanz
David Nieto Sanz

๐Ÿ›
Gil Forcada Codinachs
Gil Forcada Codinachs

๐Ÿ“– ๐Ÿ›
Nathan Hannig
Nathan Hannig

๐Ÿ›
Martin Kjellstrand
Martin Kjellstrand

๐Ÿ›
Anton Medvedev
Anton Medvedev

๐Ÿ’ป
martamedovova-ext91522
martamedovova-ext91522

๐Ÿ› ๐Ÿค”
Dr. Dirk Richter
Dr. Dirk Richter

๐Ÿค”
RatexMak
RatexMak

๐Ÿค”
horzuff
horzuff

๐Ÿ’ป
naibra
naibra

๐Ÿ›
Antti Pekka Vilkko
Antti Pekka Vilkko

๐Ÿ›
Serafรญn Martรญn
Serafรญn Martรญn

๐Ÿ›
JoostW21111
JoostW21111

๐Ÿ›
Camatius
Camatius

๐Ÿ›
terckert
terckert

๐Ÿ›
Maksim Bondarew
Maksim Bondarew

๐Ÿ›
HenrikSchuette
HenrikSchuette

๐Ÿ›
Gurunatharudh Bhandarkavathe(Infosys)
Gurunatharudh Bhandarkavathe(Infosys)

๐Ÿ›
alpip1997
alpip1997

๐Ÿ›
terolindfors
terolindfors

๐Ÿ›
Thisara Wijesundera
Thisara Wijesundera

๐Ÿค”
masudparvez
masudparvez

๐Ÿค”
gitkatsi
gitkatsi

๐Ÿ› ๐Ÿ’ป
Many Kasiriha
Many Kasiriha

๐Ÿ› ๐Ÿค”
Thulasi Raju
Thulasi Raju

๐Ÿ“–
Giancarlo Soverini
Giancarlo Soverini

๐Ÿค”
lennartq
lennartq

๐Ÿ’ป
Lukas Boekenoogen
Lukas Boekenoogen

๐Ÿ“– ๐Ÿ’ป ๐Ÿ›
anacomparada
anacomparada

๐Ÿ› ๐Ÿ“–
siongwai
siongwai

๐Ÿค” ๐Ÿ›
nfaustin
nfaustin

๐Ÿ›
Guido Schmitz
Guido Schmitz

๐Ÿ’ป
Chris Nesbitt-Smith
Chris Nesbitt-Smith

๐Ÿ’ป
vmmattila
vmmattila

๐Ÿ›
Andre-A-AtGithub
Andre-A-AtGithub

๐Ÿ›
Paweล‚
Paweล‚

๐Ÿ›
Raphael CAMUS
Raphael CAMUS

๐Ÿ›
Markus
Markus

๐Ÿค”
wojtekwp
wojtekwp

๐Ÿ›
Rudolf
Rudolf

๐Ÿ› ๐Ÿค”
Henrique Branco
Henrique Branco

๐Ÿ›
mika-b
mika-b

๐Ÿ›
okraus-ari
okraus-ari

๐Ÿ’ป
ecare-joost
ecare-joost

๐Ÿ›
PaulBrandUWV
PaulBrandUWV

๐Ÿ›
ArttuKnowit
ArttuKnowit

๐Ÿ›
T. Silvola
T. Silvola

๐Ÿ›
Teemu Kallio
Teemu Kallio

๐Ÿ›
Josรฉ Almeida
Josรฉ Almeida

๐Ÿ›
William Looman
William Looman

๐Ÿ’ป
mekxtari
mekxtari

๐Ÿค”
keef78
keef78

๐Ÿค”
Andrรฉ
Andrรฉ

๐Ÿ’ป
MarvKler
MarvKler

๐Ÿ›
Vaclav Carnogursky
Vaclav Carnogursky

๐Ÿค”
Alexander Vey
Alexander Vey

๐Ÿ›
Vaclovas Brazdauskas
Vaclovas Brazdauskas

๐Ÿ›
Benjamin Taylor
Benjamin Taylor

๐Ÿ›
Rein van der Vegt
Rein van der Vegt

๐Ÿ›
tomek
tomek

๐Ÿ›
node137
node137

๐Ÿ›
barambulka
barambulka

๐Ÿค”
timdegroot
timdegroot

๐Ÿ’ป
Samuel Montgomery-Blinn
Samuel Montgomery-Blinn

๐Ÿ’ป
Paul Chevallier
Paul Chevallier

๐Ÿ›
JaakkoPakarinen
JaakkoPakarinen

๐Ÿค”
Matias Perichon
Matias Perichon

๐Ÿค”
Lassi Heikkinen
Lassi Heikkinen

๐Ÿค” ๐Ÿ’ป
Maurice Koster
Maurice Koster

๐Ÿ›
Kitsios Konstantinos
Kitsios Konstantinos

๐Ÿ’ป
Tobias Bora
Tobias Bora

๐Ÿ›
Frank Stenzhorn
Frank Stenzhorn

๐Ÿ›
Sander van Beek
Sander van Beek

๐Ÿ› ๐Ÿ’ป
Sebastiaan Molenaar
Sebastiaan Molenaar

๐Ÿ›
David Sommers
David Sommers

๐Ÿ’ป ๐Ÿค”
Alfred_Bail
Alfred_Bail

๐Ÿ›
Eslam Elmishtawy
Eslam Elmishtawy

๐Ÿค”
Miksuu14
Miksuu14

๐Ÿค”
BastiaanTenBroeke24
BastiaanTenBroeke24

๐Ÿ’ป

Keywords

robotframework

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts