• Stars
    star
    505
  • Rank 86,778 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 25 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Robot Framework Browser library powered by Playwright.

robotframework-browser

All Contributors

Version Actions Status License


Robot Framework Browser library powered by Playwright. Moving browser automation to year 2023!

Aiming for ๐Ÿš€ speed, โœ… reliability and ๐Ÿ”ฌ visibility.

See keyword documentation and web page for more details.

Installation instructions

Only Python 3.7 or newer is supported.

  1. Install node.js e.g. from https://nodejs.org/en/download/
  2. Update pip pip install -U pip to ensure latest version is used
  3. Install robotframework-browser from the commandline: pip install robotframework-browser
  4. 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 init --skip-browsers command, but then user is responsible for browser binary installation.

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

Update instructions

To upgrade your already installed robotframework-browser library

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

Uninstall instructions

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

  1. Clean old node side dependencies and browser binaries: rfbrowser clean-node
  2. Uninstall with pip: pip uninstall robotframework-browser

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

๐Ÿค”

More Repositories

1

robotframework-requests

Robot Framework keyword library wrapper for requests
Python
479
star
2

awesome-robotframework

A curated list of awesome Robot Framework resources and libraries
Python
437
star
3

robotframework-robocop

Tool for static code analysis of Robot Framework language
Python
179
star
4

Robotframework-Database-Library

The Database Library for Robot Framework allows you to query a database and verify the results using different Python DB modules (installed separately).
RobotFramework
154
star
5

robotframework-tidy

Robot Framework code formatter
RobotFramework
102
star
6

webdrivermanager

Python module to facilitate downloading and deploying WebDriver binaries for Chrome, Firefox, Opera & Edge
Python
100
star
7

robotframework-faker

Robot Framework keyword library wrapper for faker
HTML
64
star
8

Robot-Framework-Mainframe-3270-Library

Test library for Robot Framework to allow interaction with IBM Mainframe 3270.
Python
38
star
9

robotframework-seleniumtestability

Extension for SeleniumLibrary that provides manual and automatic waiting for asyncronous events like fetch, xhr, etc.
Python
38
star
10

robotframework-angularjs

An AngularJS and Angular extension to Robotframework's SeleniumLibrary
Python
34
star
11

robotframework-openapidriver

Python
30
star
12

robotframework-style-guide

Robot Framework Style Guide
RobotFramework
27
star
13

roboswag

Python
26
star
14

robotframeworkguides

A project to share guides and best practices for robot framework and its ecosystem
MDX
25
star
15

robotframework-react

A Robot Framework library for React
JavaScript
24
star
16

robotframework-aws

Custom Library for Robot Framework to interact with Amazon Cloud Services
Python
23
star
17

robotframework-difflibrary

Robot Framework keyword library that will provide Diff capabilities
Python
23
star
18

robotframework-seleniumlibrary-java

Java port of the Python based SeleniumLibrary for Robot Framework
Java
23
star
19

robotframework-archivelibrary

HTML
22
star
20

robotframework-httprequestlibrary

Robot Framework's library to test REST interfaces utilizing Apache HttpClient
Java
21
star
21

robotframework-webservice

Webservice for running Robot Framework test cases.
Python
21
star
22

Robot-Framework-SOAP-Library

SOAP Library for Robot Framework
Python
20
star
23

robotframework-camunda

Library for testing Camunda 7 instances and workflows
Python
19
star
24

robotframework-stacktrace

A listener for RF >= 4.0 that prints a Stack Trace to console to faster find the code section where the failure appears.
Python
18
star
25

robotframework-sherlock

Robot Framework code inspector
Python
13
star
26

robotframework-reportmodifier

Python
13
star
27

robotframework-retryfailed

A listener to automatically retry tests or tasks based on tags.
Python
12
star
28

robotframework-dblibrary

A database testing library for the Robot Framework
Java
12
star
29

robotframework-openapi-libcore

Python
12
star
30

robotframework-browser-extensions

Collection of working extensions for Robot Frameworkยฎ Browser
HTML
12
star
31

ci-cd-examples

Collection of CI/CD pipelines executing Robto Framework test suites.
RobotFramework
12
star
32

robotframework-seleniumscreenshots

Robot Framework keyword library for capturing annotated screenshots with SeleniumLibrary
Nix
11
star
33

AssertionEngine

Easy way to perform assertions on Robot Framework assertions in libraries
Python
10
star
34

MarketSquare

Robot Framework Community's MarketSquare - Requests, Questions, Maintenance
10
star
35

robotframework-yamllibrary

Read or compare Yaml / Json strings by sub tree or single value
Python
10
star
36

robotframework-cluster

possible successor of Pabot
7
star
37

jupyterlab_robotmode

Robot mode for Jupyterlab
TypeScript
6
star
38

robotframework-openapitools

Python
5
star
39

robotframework-ai

Python
5
star
40

robotframework-browser.org

Vue
3
star
41

RoboConContest

This code draws the winners of RoboCon Contest 2021
RobotFramework
2
star
42

actions-robocop

Shell
2
star
43

robotframework-primefaces

An extension to Robot Framework's SeleniumLibrary for queue-based waiting on PrimeFaces pages.
Python
2
star
44

rfw-lightning

Proof of Concept to make Robot Framework more human understandable
Python
1
star
45

robotframework-browser-project-template

Robot Framework Browser library Project Template
RobotFramework
1
star
46

robot-workshop

JavaScript
1
star
47

robot-upgrade

Documentation and tooling to help upgrading Robot Framework
Python
1
star
48

robotframework-telnet-library

Robot framework keyword library for Telnet connections
1
star
49

compact_testprogram_distribution

Zipapps
1
star
50

HowToContribute

Guide on how to contribute to the open source Robot Framework project.
1
star
51

robotframework-browser-translation-fi

Browser library translation to Finnish
Python
1
star