Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.

sauce-archives/Python-Robot-Selenium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python-Robot-Selenium

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.

Environment Setup

  1. Global Dependencies

    $ brew install python
    
    • Install pip to install packages
  2. 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>
    
  3. Project Dependencies

    • Install packages (Use sudo if necessary)
    $ pip install -r requirements.txt
    

Running Tests

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/

Sauce Labs Dashboard

Advice/Troubleshooting

  1. There may be additional latency when using a remote webdriver to run tests on Sauce Labs. Timeouts or Waits may need to be increased.

Resources

  • A great resource to search for issues not explicitly covered by documentation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published