The Sauce Labs Cookbook

Sauce Headless

Front End Performance Testing

Insights

External Resources

More Info


Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Dependencies

First, add the Selenium WebDriver API to your local Python environment using pip:

pip install selenium 

# If you don't have pip installed, run:
sudo easy_install pip

 Code Example

Now let's look at a simple Python test script testing the Google front page. Despite the simplicity of this example test, it actually contains everything you need to know in order to run an automated test on Sauce Labs:

...

Include Page
_sauce description
_sauce description
 This tutorial will show you how to get started with testing with Python on Sauce. 

Table of Contents

Prerequisites

Include Page
_python_requirements
_python_requirements

Code Example

Include Page
_python_code_example
_python_code_example

Running the Example Code

Copy this code and save it into a file called first_test.py. Make sure your username and access key are included in the URL passed through to the command_executor. Then open terminal, navigate to the directory where the file is located, and execute the test by typing:

...