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

Prerequisites

Before getting started, you should read the Best Practices for Running Tests with Sauce Labs.

  • You will need to install the Selenium WebDriver client driver to your local Python environment
    You can either download the driver from the link, or use pip to install it.

    Code Block
    pip install selenium
  • You should also install the Sauce Python client, which provides features for reporting job information to the Sauce Labs dashboard. 

    Code Block
    pip install sauceclient

Code Example

This simple Python test script tests the Google front page. Despite its simplicity, it contains everything you need to know in order to run an automated test on Sauce Labs.

...

languagepy
titlePython on Sauce Code Example
linenumberstrue
collapsetrue

...

Include Page
_python_requirements
_python_requirements

Code Example

Include Page
_python_code_example
_python_code_example

 

Tip
titleWait!

The explicit wait method tells the browser to wait a set amount of time (in seconds) for elements to appear on the page before giving up. Using explicit waits is one of our recommended best practices.

...