- Getting Started with Selenium for Automated Website Testing
- Getting Started with Appium for Mobile Native Application Testing
- Selenium Bootcamp by Dave Haeffner
- Appium Bootcamp by Dave Haeffner and Matthew Edwards
This script illustrates the basic set up of a test that runs in the Sauce Labs virtual browser cloud. It includes using environment variables for authentication credentials, using tags and build numbers for test result management, and reporting the Pass/Fail status of the test to the Sauce Labs dashboard.
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.
- You should have a Sauce Labs account
- You should review the Best Practices for Running Tests
When this script runs, it opens the browser specified in the script, navigates to the saucelabs.demo web app, and then closes the browser. If you want to run this script using your Sauce Labs credentials and have it navigate to your own web app:
- Follow the instructions in Best Practice: Use Environment Variables for Authentication Credentials to set up your Sauce Labs account access.
- Enter the URL for the web app you want to test in the place of
If your website is hosted on a local network or behind a firewall, you'll need to set up sauce connect proxy to launch secure tunnels between between it and the Sauce Labs browser cloud.
- Once you've been able to run the test against your web app, you can use the Platform Configurator to experiment with changing the desired capabilities of the test.
Clone this script from the saucelabs-training GitHub repo: https://github.com/saucelabs-training/demo-js/blob/master/web-tests/instant-sauce-mocha-test4.js