It's very easy to get your existing Python tests up and running on Sauce.
Set Sauce URL and Access Credentials
If you wanted to run a Selenium test on Selenium locally, you would initiate a driver for the browser you want to test against like this.
To run a test on a remote service like Sauce Labs, all you need to change is your
driver definition, make sure that the
sauce_endpoint variable includes your Sauce
ACCESSKEY, and then pass it two parameters:
command_executor, which points to the Sauce cloud and uses your Sauce Labs authentication to log in, and
desired_capabilties, which specifies the browsers and operating systems to run the tests against.
To find your Sauce Labs access key:
- Sign in to https://saucelabs.com with the username you set up when you created your account.
You will use this same username in your test script.
- To find your access key:
- Click your name in the Account Profile menu in the upper-right corner.
- Click User Settings.
- Scroll down to Access Key and click Show.
- Enter the password you use to sign in to Sauce Labs to view the access key.
- Click the Copy icon.
Set Desired Capabilities
Once you have your tests set up to run in the Sauce cloud, you need to define the platform, browser, and version you want the test to run against, which is where desired capabilities come into play.
You can manually enter the values you want for
version, or you can use the handy Platform Configurator to generate the
desired_caps values for any combination of platform, browser, and browser version.