Robotframework browser automation tools — a review for 2021

The testing pyramid

the testing pyramid

Unit Tests

Integration Tests

E2E Tests

Robotframework Selenium Library

*** Settings ***
Documentation Simple example using SeleniumLibrary.
Library SeleniumLibrary

*** Variables ***
${LOGIN URL} http://localhost:7272
${BROWSER} Chrome

*** Test Cases ***
Valid Login
Open Browser To Login Page
Input Username demo
Input Password mode
Submit Credentials
Welcome Page Should Be Open
[Teardown] Close Browser

*** Keywords ***
Open Browser To Login Page
Open Browser ${LOGIN URL} ${BROWSER}
Title Should Be Login Page

Input Username
[Arguments] ${username}
Input Text username_field ${username}

Input Password
[Arguments] ${password}
Input Text password_field ${password}

Submit Credentials
Click Button login_button

Welcome Page Should Be Open
Title Should Be Welcome Page
*** Settings ***
Library SeleniumLibrary

*** Test Cases ***
Table Example
table should contain table-locator My-Name
table cell should contain table-locator row=3 column=6 My-Name
*** Settings ***
Library SeleniumLibrary

*** Test Cases ***
Test Case
Open Browser https://robotframework.org/ firefox
Wait Until Element Is Visible introduction
Close Browser

Robotframework-PuppeteerLibrary

*** Settings ***
Library PuppeteerLibrary
*** Test Cases ***
Submit login form
&{options} = create dictionary headless=${False}
Open browser http://127.0.0.1:7272/login-form-example.html options=${options}
Input Text id=exampleInputEmail1 demo@qahive.com
Input Text id=exampleInputPassword1 123456789
Click Element id=exampleCheck1
Run Async Keywords
... Wait For New Window Open AND
... Click Element css=button[type="submit"]
Switch Window NEW
Wait Until Page Contains Login succeeded
Close Browser
*** Settings ***
Library PuppeteerLibrary
*** Test Cases ***
Submit login form
Open browser ${HOME_PAGE_URL} options=${options}
Input Text id:username foo
Input Text id:password bar
Run Async Keywords Click Element id:login_button AND
... Wait For Request Url ${URL_API}/login POST username=demo

Robotframework-Browser

*** Settings ***
Library Browser
*** Test Cases ***
Example Test
New Page https://playwright.dev
Get Text h1 == 🎭 Playwright
*** Settings ***
Library Browser
*** Test Cases ***
Example Test
New Page http://somewebsite.com
${promise}= Promise To Wait For Response
Click \#delayed_request
${body}= Wait For ${promise}
*** Settings ***

Library Browser
*** Test Cases ***
Positive Test
New Page http://homepage.com
Fill Text #Username my-user
Fill Text #Password 1234
Click #Login
Wait Until Network Is Idle
async function myGoToKeyword(page, args) {
await page.goto(args[0]);
return await page.title();
}
exports.__esModule = true;
exports.myGoToKeyword = myGoToKeyword;
* Settings *
Library Browser jsextension=${CURDIR}/module.js
* Test Cases *
Hello
New Page
${title}= myGoToKeyword https://playwright.dev
Should be equal ${title} Playwright

Playwbot

*** Settings ***Library  playwbot.Playwbot*** Test Cases ***
Positive Test
${page}= New Page ${context}
${selector}= Convert To String xpath=/some-selector
${element}= Query Selector ${page} ${selector}
${status}= Is Visible ${element}
Should Be True ${status}==True

Conclusion

--

--

--

Automation and RPA developer, python developer.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Come Up With Programming Project Ideas

Digital Wallet(DID solution)

A quick Introduction to Java 14

Run MySQL and phpMyAdmin using Docker

7 Steps to Your Own Dockerhub Image

Get your QA Process Off the Ground

Why Fail-fast Offensive Programming is better?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Eldad Uzman

Eldad Uzman

Automation and RPA developer, python developer.

More from Medium

Elasticity Task

Choosing Your First PoC to Develop with CAIOS

A Complete Guide To Regular Expressions

PYTHON ALGORITHM…AGAIN.(Depth first search(Dfs))