NOTE: This repository is now deprecated. Please see the Demo Python project for up-to-date code samples.
This is a sample framework for working with Robotframework and Sauce Labs. It makes use of the pabot plugin for parallelization and selenium2library for working with Selenium and Sauce. This sample does work with Python 2.7 and Python 3.6.
This code is provided on an "AS-IS” basis without warranty of any kind, either express or implied, including without limitation any implied warranties of condition, uninterrupted use, merchantability, fitness for a particular purpose, or non-infringement. Your tests and testing environments may require you to modify this framework. Issues regarding this framework should be submitted through GitHub. For questions regarding Sauce Labs integration, please see the Sauce Labs documentation at https://wiki.saucelabs.com/. This framework is not maintained by Sauce Labs Support.
Note: Robot framework does not currently support Microsoft Edge. However, if you set the robot browser to firefox and then specify "MicrosoftEdge" in the desired capabilities for Sauce Labs, the tests will run as expected.
-
Global Dependencies
- Install Python
- Or Install Python with Homebrew
$ brew install python
- Install pip to install packages
-
Sauce Credentials
- In the terminal export your Sauce Labs Credentials as environmental variables:
$ export SAUCE_USERNAME=<your Sauce Labs username> $ export SAUCE_ACCESS_KEY=<your Sauce Labs access key>
-
Project Dependencies
- Install packages (Use sudo if necessary)
$ pip install -r requirements.txt
Tests in Series: To run tests in parallel, use the robot
executor and a browser config file like this:
robot -A chrome_config.txt Tests/
Tests in Parallel: To run tests in parallel against a single browser, use the pabot
executor and run one of
pabot -A chrome_config.txt Tests/
pabot -A firefox_config.txt Tests/
pabot -A ie_config.txt Tests/
and to run all tests in parallel across all browsers, run
pabot --argumentfile1 chrome_config.txt --argumentfile2 firefox_config.txt --argumentfile3 ie_config.txt Tests/
- There may be additional latency when using a remote webdriver to run tests on Sauce Labs. Timeouts or Waits may need to be increased.
- A great resource to search for issues not explicitly covered by documentation.