Skip to content

Instantly share code, notes, and snippets.

@ashwingonsalves
Forked from ujwalp1994/BrowserStack.robot
Last active February 27, 2020 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashwingonsalves/5258ccdd331d8d9d103dd9c6561fcbf1 to your computer and use it in GitHub Desktop.
Save ashwingonsalves/5258ccdd331d8d9d103dd9c6561fcbf1 to your computer and use it in GitHub Desktop.
Sample Test to run Robot tests on BrowserStack
*** Settings ***
Library Selenium2Library
Library Collections
Library Collections
Library String
Library BuiltIn
*** Variables ***
${SITE_URL} = https://www.browserstack.com
${SELENIUM_TIME_OUT} = 120
${SELENIUM_SPEED} = 0.45
${BROWSER} = Chrome
${REMOTE_URL} = http://USERNAME:ACCESS_KEY@hub.browserstack.com:80/wd/hub
${DC}
*** Test Cases ***
TC001_BrowserStack_Test
Close All Browsers
Set Selenium Timeout ${SELENIUM_TIME_OUT}
Set Selenium Speed ${SELENIUM_SPEED}
Open Browser ${SITE_URL} ${BROWSER} remote_url=${REMOTE_URL} desired_capabilities=${DC}
Maximize Browser Window
Close Browser
@ashwingonsalves
Copy link
Author

ashwingonsalves commented Nov 20, 2018

Steps to Configure:

Step-1: Download and install Python. Check the installed version using pip --version
Step-2: Install Robot framework using pip install robotframework
Step-3: Install Selenium2Library using pip install robotframework-selenium2library
Step-4: Install Selenium if not already installed using pip install -U selenium
Step-5: Download the sample file and execute using the following command:

robot -v DC:"os:Windows,os_version:10,browser:Chrome,browser_version:62.0" BrowserStack.robot

Note: The parameters under the dictionary DC are desired capabilities for executing tests on BrowserStack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment