Sharing Test Results

Once your test has run and generated a Test Details page, you have several options for sharing a link to that page with others.

  1. In Sauce Labs, in the left panel, click LIVE or AUTOMATED, and then click Test Results.
  2. On the Test Results page, click a test in the list to view the test details.
  3. In the Visibility dropdown, select a sharing option for the test results.
OptionExplanation
PublicEveryone will be able to view the test results, and they may be listed on public web pages and indexed by search engines.
Public RestrictedEveryone will be able to view the test results, but only you will have log access. By restricting access to the raw Selenium log and the job log, you can prevent sensitive information, such as passwords, from being visible to others.
PrivateOnly you will be able to view the test results.
TeamAll members of your team will be able to view the test results.
ShareOnly people who have the link to the test will be able to view the test results.
Manually Share a Link

You can also manually build links to Test Results pages and set authentication for accessing them using the methods described in Building Sharable Links to Test Results. To manually share the test results, copy and send the URL of the Test Results page.

Building Sharable Links#

You can generate a sharable link to your test results that limits who can view the results by requiring a login or authentication (auth) token. These links will allow recipients to view the results of that test, but the they will not appear on their dashboard.

You can also change the visibility of a test (e.g., Public, Private, or Team) directly on the Test Results page.

Does Not Work with Legacy RDC Platform

The following information does not currently work with the legacy RDC platform (TestObject).

Does Not Work with Legacy RDC Platform

The following information does not currently work with the legacy RDC platform (TestObject).

When generating a shareable link, you'll need to know your specific data center. All examples on this page use the US West 1 data center endpoint, app.saucelabs.com. If you're using a different data center, such as EU Central 1, your link should be edited accordingly:

https://app.eu-central-1.saucelabs.com/tests/YOUR_TEST_ID).

See Data Center Endpoints for more info.

Linking to Tests that Require a Login to View#

You can create links to your tests that will only work if you're logged in with the account that ran the test.

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 sessionId or session_id, depending on the client library. Sauce uses that session ID as the test 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_TEST_ID with the session ID:

https://app.saucelabs.com/tests/YOUR_TEST_ID

As previously mentioned, all examples on this page use the US West 1 data center endpoint. If you're using a different data center, such as EU Central 1, your link should be edited accordingly:

https://app.eu-central-1.saucelabs.com/tests/YOUR_TEST_ID

See Data Center Endpoints for more info.

Linking to Tests that Don't Require a Login to View#

You can also create sharable links that are based on authentication (auth) tokens, meaning the recipient won't have to log in and use your credentials.

Auth tokens are generated on a per-test basis and grant viewers 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:

  • Key: SAUCE_USERNAME:SAUCE_ACCESS_KEY
  • Message: YOUR_TEST_ID

The example below demonstrates how to generate the token in a Python interpreter for a test with the id: 5f9fef27854ca50a3c132ce331cb6034:

>>> import hmac
>>> from hashlib import md5
>>> hmac.new("SAUCE_USERNAME:SAUCE_ACCESS_KEY", "5f9fef27854ca50a3c132ce331cb6034", md5).hexdigest()
Once the auth token has been obtained, you can use it to build a link in this format: https://app.saucelabs.com/tests/YOUR_TEST_ID?auth=AUTH_TOKEN.

Support for Secondary Accounts#

If you want to authenticate as another user, just prefix the auth token with your user name, followed by a colon.

For example:

https://app.saucelabs.com/tests/YOUR_TEST_ID?auth=SAUCE_USERNAME:AUTH_TOKEN.

Setting Your Test Links to Expire#

You can extend the links generated with authentication tokens to make them work temporarily for a specific date or specific hour, based on the parameters that you set.

During the hmac generation, set the key like this: SAUCE_USERNAME:SAUCE_ACCESS_KEY:YOUR_DATE_RANGE.

The date range can take two formats: YYYY-MM-DD-HH and YYYY-MM-DD. These should be set in UTC time and will only work during the date or hour you set.

Embedding Test Results in HTML Pages#

Authentication Required#

Both of these configurations will only work for browsers logged in using your account, but you can use authentication tokens to make this work for anonymous viewers. For more information about creating authentication tokens, see Building Sharable Links.

https://app.saucelabs.com/video-embed/YOUR_JOB_ID.js?auth=AUTH_TOKEN

Embedding Pages for EU DC and Headless DC#

To embed the page for EU DC test, you need to use the app.eu-central-1.saucelabs.com domain.

https://app.[eu-central-1|us-east-1].saucelabs.com/video-embed/YOUR_JOB_ID.js?auth=AUTH_TOKEN
https://app.saucelabs.com/video-embed/YOUR_JOB_ID.js?auth=AUTH_TOKEN

Embedding Pages for EU DC and Headless DC#

https://app.saucelabs.com/job-embed/YOUR_JOB_ID.js
https://app.[eu-central-1|us-east-1].saucelabs.com/video-embed/YOUR_JOB_ID.js?auth=AUTH_TOKEN

Embedding Full Test Pages#

You can embed test pages in CI test results or other test reports. Using the following format, add the HTML to any page where you need to embed test results, replacing YOUR_JOB_ID with the ID of the job you want:

https://app.saucelabs.com/job-embed/YOUR_JOB_ID.js

Embedding the Video Player#

You can also embed videos in CI test results or other test reports. Using the format below, add the HTML to any page where you want to embed job videos, replacing YOUR_JOB_ID with the ID of the job you want:

https://app.saucelabs.com/video-embed/YOUR_JOB_ID.js

Optional Parameters#

By default, an embedded test iframe has a width of 1024px and a height of 768px. If you want to change the iframe size, use the "width" and "height" query parameters.

For example:

https://app.saucelabs.com/video-embed/YOUR_JOB_ID.js?width=100&height=100
Last updated on by Laura Thomas