The Sauce Labs Cookbook

Sauce Headless

Front End Performance Testing

Insights

External Resources

More Info


Page tree
Skip to end of metadata
Go to start of metadata

What You'll Need

  • Knowledge of your preferred data center
  • Knowledge of your desired device models and their respective region (data center)
  • Your Sauce Labs Credentials (Test Object API Keys will no longer work)
  • A mobile application (if you don't have one readily available, you can use our Sample Mobile App for testing)

Application Upload and Versioning

The Sauce Labs platform provides options for uploading files (applications, binaries, pre-run executable scripts, etc.). To learn more about how to upload your application for testing, please visit Application Storage.

User Management on the Sauce Labs Platform

The Sauce Labs platform uses extended team management in order to assign users to teams, bestow user privileges, and manage device/VM concurrency. To modify or view user access and privileges log into the Sauce Labs Platform and go to Account > Team Management. Visit the Extended Team Management wiki page for more information on how to use the Team Management feature.

Note about User Management for Former TestObject Users

It's imperative that users migrating from the Legacy Real Device Platform (Test Object) confirm their entitlements that carried over; and also that their platform privileges at least mimic what they had in TestObject.

Migrating from the Legacy Real Device Platform

This page is a guide for all Sauce users migrating from our Legacy Real Device Platform (TestObject) to our new Real Device Testing in Sauce Labs platform. The new platform was designed to give users a unified mobile and virtual experience across all of our products; including a single UI, API, login, and test experience. The purpose of this page is to help make this process more seamless and provide a checklist for the necessary steps.

Modifying Real Device Test Builds

In order to utilize and reach the new unified platform, you'll need to modify your existing test builds. Below are the necessary steps in order to achieve success on the Sauce Labs platform.

Step 1: Gather Your Sauce Labs Credentials

You will need to replace your Test Object credentials with Sauce Labs credentials. To verify the credentials, log into the Sauce Labs platform and go to Account > User Settings in order to view your username and access key. For more information, see Best Practice: Use Environment Variables for Authentication Credentials.

Step 2: Change Remote URL from Test Object Endpoint to the Sauce Labs Endpoint

You will need to replace your Remote URL endpoint from Test Object platform to the Sauce Labs platform, for example:

Also, if you're using Sauce Connect Proxy, the REST API, or any other features, consult with the Data Center Endpoints documentation for further information.

Step 3: Change Device Test Options

Not all device model and operating system combinations will carry over from the Test Object platform. Therefore you may need to adjust your device capabilities in your test configuration. To ensure your preferred device allocations still work, consult with the list of available devices for your region by logging into the Sauce Labs platform and go to Live > Cross-Browser > Mobile Real. Please note that you may see a different device list if you switch your Data Center in the upper right corner of the user interface. You may also need to validate that your Appium capabilities still work with the RDC on Sauce Labs platform: Appium Capabilities for Real Device Testing.

For a full list of supported devices and platforms (non-region specific), see Supported Browsers and Devices.

Step 4: Re-Upload your Application to Sauce Application Storage

Finally, in order to access your application using the new Sauce Labs Application Storage you must:

  • re-upload the application to Sauce Labs Application Storage
  • change the way you reference the application in your test code capabilities. For example, in the app capability you must use storage:<app-id>, or storage:filename=<some-app.apk>, rather than sauce-storage:<myapp.apk>
    For more information on this step, see Application Storage > Using Application Storage with Automated Test Builds.

Applications stored in the Test Object platform storage will no longer be accessible after some time. Visit Uploading and Accessing Applications with Real Devices for further information.

Use Application Storage with Virtual Device Tests

Application Storage also allows you to upload and test your application with virtual devices and it uses the same process, for example:

  • Change the app capability to storage:<app-id>, or storage:filename=<some-app.apk>.
  • Change the ondemand endpoint to https://ondemand.us-west-1.saucelabs.com/wd/hub if you're running virtual device tests in the US-WEST data center. The EU-CENTRAL data center endpoint remains the same for virtual device tests.

Step 5: Transitioning to the Sauce Labs REST API

If your organization uses the  Test Object REST API for helper classes or reporting purposes, support for these endpoints will change or end. Please refer to the chart below for the RDC on Sauce Labs equivalent endpoints and review the following pages for context:

Test Object Endpoint

RDC on Sauce Labs EndpointExplanation / Relevant Wiki Pages

Base API

https://app.testobject.com/api/rest/https://api.us-west-1.saucelabs.com/US Data Center REST API
https://app.testobject.com/api/rest/https://api.eu-central-1.saucelabs.com/EU Data Center REST API

Storage API

storage/uploadv1/storage/$SAUCE_USERNAME/$FILE_NAMERDC on Sauce Labs will now use methods mentioned in Application Storage.

Appium Watcher API

v2/appium/session/{sessionId}/skiptestN/ANo Longer Supported / Deprecated
v2/appium/session/{sessionId}/testN/ANo Longer Supported / Deprecated

Appium Suites API

v2/appium/suites/{batchId}

v1/analytics/trends/builds_tests

Appium suites will no longer be supported. Sauce Labs recommends using the Sauce Insights Methods, specifically Build And Test Statistics.
v2/appium/suites/{batchId}/deviceIdsN/ANo Longer Supported / Deprecated
v1/appium/suites/{batchId}/reports/startN/ANo Longer Supported / Deprecated
v2/appium/suites/{batchId}/reports/{batchReportId}/finishN/ANo Longer Supported / Deprecated
v2/appium/suites/{batchId}/reports/{batchReportId}/results/{testReportId}/finishN/ANo Longer Supported / Deprecated
v2/appium/suites/{batchId}/reports/{batchReportId}/results/{testReportId}/skipN/ANo Longer Supported / Deprecated

Devices API

v2/devicesv1/rdc/devicesThe Get Devices functionality will remain the same with one caveat, when calling this endpoint you must specify the data center. Refer to the table at the top of this section and Data Center Endpoints for more information.
v2/devices/availablev1/rdc/devices/availableThe Get IDs of Available Devices functionality will remain the same with one caveat, when calling this endpoint you must specify the data center. Refer to the table at the top of this section and Data Center Endpoints for more information.
v2/devices/{deviceDescriptorId}v1/rdc/devices/$DEVICE_IDThe Get Device functionality will remain the same with one caveat, when calling this endpoint you must specify the data center. Refer to the table at the top of this section and Data Center Endpoints for more information.

Test Reports API

v2/reports/{testReportId}v1/rdc/jobs/$JOB_IDSupport for testReportId will now use the Get Job.

Logs API

  • v2/logs/{testReportId}/appium
  • v2/logs/{testReportId}/device
  • v2/logs/{testReportId}/vitals
  • v2/logs/{testReportId}/xcuitest
rest/v1/$SAUCE_RDC_USERNAME/jobs/$JOB_ID/assets/$FILE_NAMESupport for downloading test asset files (logs, videos, screenshots etc.) requires using Get Job Asset Files. Also, downloading specific files requires you to know the names of said files. See Get Job Asset Names for more context.
v2/logs/{testReportId}rest/v1/$SAUCE_RDC_USERNAME/jobs/$JOB_ID/assetsThe Get Job Asset Names method returns the names of assets associated with a given test/job in JSON format.

Session Report API

v1/devices/reportsv1/rdc/jobsFor general information about test runs in RDC on Sauce Labs, use the Get Jobs method, along with specific query parameters, in order to narrow the response data.

Screenshot API

v2/screenshots/{testReportId}/{screenshotId}.pngrest/v1/$SAUCE_RDC_USERNAME/jobs/$JOB_ID/assets/$FILE_NAMESupport for downloading test asset files (logs, videos, screenshots etc.) requires using Get Job Asset Files. Also, downloading specific screenshots require you to know the names of said screenshot. See Get Job Asset Names for more context.

Suite Reports API

v2/batchReports/{batchReportId}N/ANo Longer Supported / Deprecated
v2/batchReports/{batchReportId}/xmlN/ANo Longer Supported / Deprecated

Session Video API

v2/video/{videoId}.mp4rest/v1/$SAUCE_RDC_USERNAME/jobs/$JOB_ID/assets/$FILE_NAMESupport for downloading test asset files (logs, videos, screenshots etc.) requires using Get Job Asset Files. Also, downloading a specific video requires you to know the name of said video. See Get Job Asset Names for more context.








  • No labels