NOTE: This repo is outdated and no longer being maintained. Please refer to the new Robot framework repos;
- BrowserStack Integration with Robot Framework Selenium
- BrowserStack Integration with Robot Framework Appium
- Clone the repo
- Install dependencies
pip install robotframework
&&pip install --upgrade robotframework-seleniumlibrary
pip install robotframework-pabot
-> This is for parallelization- For Appium,
pip install robotframework-appiumlibrary
.For more information refer https://github.com/serhatbolsu/robotframework-appiumlibrary - Note: This is w.r.t Python3
-
You can export the environment variables for the Username and Access Key of your BrowserStack account.
export BROWSERSTACK_USERNAME=<browserstack-username> && export BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>
- Navigate to
cd web/test
- To run single test, run
robot SingleTest.robot
- To run local tests
- Start the
BrowserStack Local Binary
in advance. https://www.browserstack.com/local-testing/automate - Run
robot LocalTest.robot
- Start the
- To run parallel tests, navigate to 'parallel' folder, run
cd parallel
- Test Suite level
- Run
pabot --processes <count_of_parallels> *.robot
- Alternate method:
pabot --processes <count_of_parallels> <name_of_suites_to_run>
Eg:pabot --processes 2 Suite1.robot Suite2.robot
- Test case level
- Run
pabot --testlevelsplit <file_name>
Eg:pabot --testlevelsplit Suite1.robot
- Run Test cases and Test suites together in parallel
- Run
pabot --testlevelsplit --processes <count_of_parallels> *.robot
- Note: If the process count exceeds the parallel thread limit, it will automatically get queued. No changes required in the scripts.
- Navigate to
cd app/test
- Upload app: https://www.browserstack.com/app-automate/appium-python#getting-started
- Add "app_url" to the script. Eg:
- Android
Open Application ${REMOTE_URL} app=bs://<app_url> name=single_test build=RobotFramework platformName=Android os_version=7.0 device=Samsung Galaxy S8
- iOS
Open Application ${REMOTE_URL} app=bs://<app_url> name=single_test build=RobotFramework platformName=iOS os_version=11.0 device=iPhone 8 Plus
- To run single test, run
robot Appium_android.robot
OR runrobot Appium_ios.robot
- Parallel Execution: Same process as Automate
- Android: Replace
browser
(i.e. &{DC}[browser]) parameter inOpen Browser
toandroid
- iOS: Replace
browser
(i.e. &{DC}[browser]) parameter inOpen Browser
toiphone
Understand how many parallel sessions you need by using our Parallel Test Calculator
- You can view your test results on the BrowserStack Automate dashboard
- To test on a different set of browsers, check out our platform configurator