The Sauce Labs Cookbook

Sauce Headless

Front End Performance Testing

Insights

External Resources

More Info


Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 33 Next »

This script provides an example of how you might configure your own automated tests to run in the Sauce Labs browser cloud. The sample test uses environment variables for authentication, assigns a tag and build number for test result management, and reports Pass/Fail status to the Sauce Labs dashboard.

Example Only

The code in this topic is presented as an example only, since your tests and testing environments may require specialized scripting. This information should be taken only as an illustration of how you could set up your tests with Sauce Labs, and is not directly supported by Sauce.

Prerequisites

Setup Example Script

The sample test opens the browser, navigates to the saucelabs.demo web app, and then closes the browser.

To run this script against your own app using your Sauce Labs credentials:

  1. Set your authentication credentials as environment variables to connect the test to your Sauce Labs account.
  2. Enter the URL for the web app you want to test in the place of saucedemo.com.

Once you've been able to run the test against your web app, check out the Platform Configurator to see more of the desired capabilities you can use when testing with Sauce. 

Clone this script from the saucelabs-training GitHub repo: https://github.com/saucelabs-training/demo-python/blob/master/pytest/instant-sauce-pytest4.py

Not found

Could not read the file pytest/instant-sauce-pytest4.py

  • No labels