Skip to content

Instantly share code, notes, and snippets.

@ujwalp1994
Created July 4, 2017 14:34
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ujwalp1994/fbb77e850a4f38016922d31f5e39145c 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://sprint-005-origin.levi-site.com/CA/en_CA/
${SELENIUM_TIME_OUT} = 120
${SELENIUM_SPEED} = 0.45
${BROWSER} = IE
${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
@ujwalp1994
Copy link
Author

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:

pybot -v DC:"os:Windows,browser:Firefox,browserstack.local:true" 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