Package: robotframework-browser
robotframework-browserRobot FrameworkBrowser library powered byPlaywright. Moving browser automation to year 2023!Aiming for :rocket: speed, :white_check_mark: reliability and :microscope: visibility.Seekeyword documentationandweb pagefor more details.Installation instructionsOnly Python 3.8 or newer is supported. From Node side 18 and 20 LTS versions are supported.Install node.js e.g. fromhttps://nodejs.org/en/download/Update pippip install -U pipto ensure latest version is usedInstall robotframework-browser from the commandline:pip install robotframework-browserInstall the node dependencies: runrfbrowser initin your shellifrfbrowseris not found, trypython -m Browser.entry initPlease 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 withrfbrowser init --skip-browserscommand, but then user
is responsible for browser binary installation. It is possible to install only selected browser binaries by addingchromium,firefoxorwebkitas arguments to init command. Examplerfbrowser init firefoxwould install
only Firefox binaries andrfbrowser init firefox chromiumwould install both Firefox and Chromium binaries.Or use thedocker images. Documented atdocker/README.md.Update instructionsTo upgrade your already installed robotframework-browser libraryUpdate from commandline:pip install -U robotframework-browserClean old node side dependencies and browser binaries:rfbrowser clean-nodeInstall the node dependencies for the newly installed version:rfbrowser initUninstall instructionsTo completely install library, including the browser binaries installed by Playwright,
run following commands:Clean old node side dependencies and browser binaries:rfbrowser clean-nodeUninstall with pip:pip uninstall robotframework-browserExamplesTesting withRobot Framework*** Settings ***LibraryBrowser*** Test Cases ***Example TestNew Pagehttps://playwright.devGet Texth1containsPlaywrightand testing withPython.importBrowserbrowser=Browser.Browser()browser.new_page("https://playwright.dev")assert'Playwright'inbrowser.get_text("h1")browser.close_browser()and extending with JavaScriptasyncfunctionmyGoToKeyword(url,page,logger){logger("Going to "+url)returnawaitpage.goto(url);}myGoToKeyword.rfdoc="This is my own go to keyword";exports.__esModule=true;exports.myGoToKeyword=myGoToKeyword;*** Settings ***LibraryBrowserjsextension=${CURDIR}/mymodule.js*** Test Cases ***Example TestNew PagemyGoToKeywordhttps://www.robotframework.orgSeeexample.
Ready made extensions and a place to share your own atrobotframework-browser-extensions.Ergonomic selector syntax, supports chaining oftext,cssandxpathselectors# Select element containing text "Login" with text selector strategy# and select it's parent `input` element with xpathClick"Login" >> xpath=../input# Select element with CSS strategy and select button in it with text strategyClickdiv.dialog >> "Ok"Evaluate in browser pageNew Page${LOGIN_URL}${ref}=Get Elementh1Get Property${ref}innerText==Login PageEvaluate JavaScript${ref}(elem) => elem.innerText = "abc"Get Property${ref}innerText==abcAsynchronously 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 ToWait For Responsematcher=timeout=3sClick\#delayed_request${body}=Wait For${promise}Device Descriptors${device}=Get DeviceiPhone XNew Context&{device}New PageGet Viewport Size# returns { "width": 375, "height": 812 }Sending HTTP requests and parsing their responses${response}=HTTP/api/postPOST{"name": "John"}Should Be Equal${response.status}${200}Parallel test execution using PabotYou can let RF Browser spawn separate processes for every pabot process. This is very simple, just run the tests normally using pabot (seehttps://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 theROBOT_FRAMEWORK_BROWSER_NODE_PORTenvironment variable, andfrom Browser.utils import spawn_node_processhelper (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 credentialsFigure out how the page is storing authenticationIf it is localstorage or cookiesSave Storage Stateshould work. See usage example:https://marketsquare.github.io/robotframework-browser/Browser.html#Save%20Storage%20StateDevelopmentSeeCONTRIBUTING.mdfor development instructions.Core teamIn order of appearance.Mikko KorpelaTatu AaltoJanne Härkönen (Alumnus)Kerkko PelttariRené RohnerContributorsThis project is community driven and becomes a reality only through the work of all the people who contribute.
Supported byRobocorpthroughRobot Framework Foundation.Mikko Korpela💻Tatu Aalto💻Antti Karjalainen🔍Ismo Aro🔍Janne Härkönen💻Kerkko Pelttari💻Robocorp💵René💻Bryan Oakley🤔Tanakiat Srisaranyakul🤔Maaret Pyhäjärvi📓Karlo Smid📓Frank Schimmel📓Christoph⚠️Mika Hänninen💬imbus💵Niklas📖gdroes⚠️Reaktor💵Adrian Yorke📖👀Nanakawa⚠️Ed Manlove📖🐛Brian Tsao🐛📓charis💻🐛s-galante🐛Simon Meggle📓🐛⚠️🤔Anna-Gunda🐛anton264📓emakaay🐛Nea Ohvo🐛Elout van Leeuwen📖🤔💻LDerikx📖olga-📖🐛Nicholas Bollweg📖Ville Salonen🐛Jani Mikkonen🐛Aleh Borysiewicz🐛Jürgen Knauth🐛dalaakso🐛msirkka🤔Ossi R.💻Adrian V.💻🐛🤔Sami Sallmén🐛⚠️Pekka Klärck💻🐛Jani Palsamäki🐛AllanMedeiros🐛Emmanuel Alap🐛💻ankurbhalla-gmail🤔UliSei🤔🐛💻📓Tomasz Pawlak🐛mtoskamp🐛zastress🐛Juga Paazmaya💻Raphael Smadja🤔💻🐛Antti Pakkanen🐛Luis A Gomez-Tinoco🐛💡💻ePlanLori🐛laguna357🐛Gavin Rodgers🐛pokaalinkanssayohon🤔Ryan Sandbach🐛💻Niko Kahilainen🐛Guillaume Gautier📖Robin Matz🤔Stavros Ntentos📖Massukio🐛🤔Atihinen🐛gvrkumar🤔Lauri Helkkula🐛rlall07🐛🤔Eldad Uzman🤔mgarcibu🐛DominikG🤔jokinr⚠️🐛Jier Chen💻IDvoe🐛Cosmin Poieana🐛Shenthil🐛Marduk Bolaños🐛🤔amodzelewski🐛TimDicos🐛vinismarques🐛nizwiz🐛Reddriver🤔Seppo🐛rousku🐛tomaspekarovic🤔Robin Mackaij🐛nixuewei🤔Slava🤔🐛💻Kari Harju🐛you🐛axiom41🐛amankul🐛jcb-entrnce🐛Remppa🐛Tomasz Pawlak🐛Timo Stordell🐛Marcin Gmurczyk💻Daniel Biehl🐛🤔rarajabs🐛Sandeep Vaidya🤔falk📖ciadoh🐛Johan van Iperen💻Fabio Zadrozny🐛BCGST📖Wilfried van Asten🐛💻Mikal H Henriksen🐛alexinoDr🐛trybuskrzysztof🐛Aino1980🐛BjornAhmark🐛Mezohren🐛Zoupers Zou🤔lasselindqvist🐛David Nieto Sanz🐛Gil Forcada Codinachs📖🐛Nathan Hannig🐛Martin Kjellstrand🐛Anton Medvedev💻martamedovova-ext91522🐛🤔Dr. Dirk Richter🤔RatexMak🤔horzuff💻naibra🐛Antti Pekka Vilkko🐛Serafín Martín🐛JoostW21111🐛Camatius🐛terckert🐛Maksim Bondarew🐛HenrikSchuette🐛Gurunatharudh Bhandarkavathe(Infosys)🐛alpip1997🐛terolindfors🐛Thisara Wijesundera🤔masudparvez🤔gitkatsi🐛💻