Robot Framework & Playwright

Browser Library allows you to run Playwright tests with Robot Framework. By using TestingBot, you will be able to run Robot tests using Playwright on TestingBot's browser grid. The advantage is that you do not have to set up and maintain a fleet of different browsers, versions and operating systems. Another advantage is that you can run multiple tests, in parallel, on TestingBot's grid.


Below is an example on how to connect to the TestingBot browser grid, using Browser Library's Connect To Browser. To run the test, simply save it in a file (for example test.robo) and call python -m robot test.robo from the command line.

*** Settings ***
Library    Browser
Test Setup  Setup TestingBot

*** Variables ***
&{desiredCapabilities}      platform=WIN10
...                         browserName=chrome
...                         key=add-your-TestingBot-key
...                         secret=add-your-TestingBot-secret

*** Keywords ***
Setup TestingBot
    ${TBCAPS}            Evaluate    urllib.parse.quote( json.dumps(${desiredCapabilities}) )
    Connect To Browser          wsEndpoint=wss://cloud.testingbot.com/playwright?capabilities=${TBCAPS}

*** Test Cases ***
Playwright Test
    New Page    https://playwright.dev/
    Get Title    matches   Playwright
    Get Attribute    "Get started"    href    ==    /docs/intro
    Click    "Get started"
    Get Url    matches    .*intro

This example will open a Chrome browser using Playwright on TestingBot, navigate to the Playwright website and do some verifications.