1

Is it possible to use BrowserStack when using Browser library in RobotFramework

There is an article on how to do it with SeleniumLibrary ( https://medium.com/detesters/integrating-robot-framework-with-browserstock-bddf5b0e0c14 )

and also an article on how to do it with Playwright directly (see this page )

But can it be done with Browser library, and if yes, how is that done?

1

1 Answer 1

1

With the following init.robot file:

*** Settings ***
Force Tags       test
Documentation    Test Suite
Suite Setup      Setup Browserstack
Resource         ../Variables/variables.robot
Library          Browser

*** Variables ***
&{desiredCapabilities}      os=Windows
...                         os_version=10
...                         browser=chrome
...                         name=TestInit
...                         browserstack.username=${BROWSERSTACK_USERNAME}
...                         browserstack.accessKey=${BROWSERSTACK_ACCESSKEY}
...                         client.playwrightVersion=1.17.2

*** Keywords ***
Setup Browserstack
    ${BSENCODEDCAPS}            Evaluate    urllib.parse.quote( json.dumps(${desiredCapabilities}) )
    Connect To Browser          wss://cdp.browserstack.com/playwright?caps=${BSENCODEDCAPS}

It took some time, but with the help of a great colleague I was able to get this.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.