- 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
There are three types of links you can create to provide access to your tests. These links will let whoever you share them with view the Test Details page for that test, but the test results will not appear in their dashboard. You can also create links by setting the Sharing options on the Test Details page, and then sharing the link to that page.
Links to Jobs that Require a Login to View
In Selenium, when a client requests a new browser session, the server returns a session ID, which is used to identify that session throughout the test. The session ID is stored as a member variable of the instantiated Selenium object and named
session_id, depending on the client library. Sauce uses that session ID as the job id for accessing test results.
To directly access a specific job, you will first need to note the session ID locally, usually by writing it to a log file. You can then use it to create a URL with the following format and replace
YOUR_JOB_ID with the session ID.
Notice that links to jobs in this format will only work if you are logged in with the account that ran the job or if that account is a sub-account of yours. For generating public links, see the next section.
Links to Jobs that Don't Require a Login to View
The links you create to your jobs i can be constructed in a way that doesn't require anonymous viewers to login and use your credentials. This is based on authentication tokens.
Auth tokens are generated on a per-job basis and give the receiver access using an hmac-based algorithm. You can also find hmac implementations for different programming languages.
The digest algorithm to use is MD5. The message and key used to generate the token should be the following:
Here's an example in Python for generating the token in the Python interpreter for a job with id:
Once the auth token has been obtained, you can use it to build a link in this format: https://saucelabs.com/jobs/YOUR_JOB_ID?auth=AUTH_TOKEN
Support for secondary accounts
If you want to authenticate as another user, just prefix the auth token with your username, followed by a colon. For example:
Temporary Links to Jobs
You can extend the links generated with authentication tokens to make them work for either one day or one hour duration, based on parameters that you set. During the hmac generation, set the key like this:
The date range can take two formats:
YYYY-MM-DD. These should be set in UTC time and will only work during the date or hour you set.