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.
What You'll Need
- You should have a Sauce Labs account
- You should review the Best Practices for Running Tests
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:
- Set your authentication credentials as environment variables to connect the test to your Sauce Labs account.
- Enter the URL for the web app you want to test in the place of
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.
Download the following script from saucelabs-training on GitHub:
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.