Before getting started, you should read the Python Test Setup the Best Practices for Running Tests with Sauce Labs Tutorial.
You will need to install the Selenium WebDriver client driver to your local Python environment
You can either download the driver from the link, or use
pipto install it.
pip install selenium
You should also install the Sauce Python client, which provides features for reporting job information to the Sauce Labs dashboard.
pip install sauceclient
Before you start running tests in parallel, you should review the Python Test Setup Best Practices for Running Tests with Sauce Labs Tutorial, especially the topics on avoiding external test dependencies and avoiding dependencies between tests.
The number of tests you can run in parallel is determined by the concurrency limit associated with your account. You can check this in you Sauce Labs dashboard under Concurrent VMs.
# this authenticates you from sauceclient import SauceClient sauce_client = SauceClient("YOUR_SAUCE_USERNAME", "YOUR_SAUCE_ACCESSKEY") # this belongs in your test logic sauce_client.jobs.update_job(driver.session_id, passed=True)
You should also follow our recommended best practice of adding build numbers, tags, and other identifying information to your tests so you can easily find and manage them in your test results and archives pages.