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 have a Selenium environment with the C# bindings set up on a local machine where you'll launch your tests. If you need help with setting this up, check out the ReadMe in the C# sample script repository on GitHub.
- 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.
Clone 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.