The Sauce Labs Cookbook

Sauce Headless

Front End Performance Testing

Analytics

External Resources

More Info


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

Please select your preferred method for uploading your application in order to view the instructions:

Using the Real Devices on Sauce Labs UI:

Manual Upload for Live Testing Only

Currently, the manual application upload feature is only available for the Live Testing use case. Please visit this page for more information.


Using the Legacy Test Object UI:

  1. Log into your account. 
  2. Select whether you want to create an Android, iOS, or web-based mobile application project
    1. For an application project, browse to the file containing your application, and upload it.

    2. For a website project, enter the URLName, and Version Number for the website. 
  3. Enter the Device Settings for your project.

    DO NOT set a PIN lock at any point when managing the device settings; this disables the device and disrupts the device maintenance process. Refer to this page for more details

  4. Click Save.
  5. Your project will appear on the Apps dashboard.  
  6. Select your project to view the project dashboard. 
    On the project dashboard you can now select Manual or Automated Tests to begin testing your project. Once your tests run, you can view the results by selecting the type of test.

When you create a real device project, normally you upload and store the application you want to test on the Sauce Labs servers. As you develop your application and upload new versions of it, Sauce Labs will keep track of the different versions. However, there may be situations where you want to install an application directly onto a real device from a remote location. The application is completely removed from the real device after the test completes, providing an added layer of security for your application.


Each Session is a "Fresh" Install

You will not be able to access information about different versions of your application because each session includes a "fresh" installation of your application. 

For Automated Appium Testing Only

You can only install remote applications for automated Appium testing. Espresso and Robotium automated tests are not supported. Live Testing is also not supported.

Using the Real Devices on Sauce Labs:

There may be situations where you want to install an application from a downloadable remote location (AWS S3 bucket, a GitHub repository, etc.). Please review the following guidelines below before uploading your application:

  1. Make sure your application meets the prerequisite requirements for Android and iOS Mobile Application Testing.
  2. Upload your application to the hosting location.
  3. Ensure Sauce Labs has READ access to the app URL.
  4. In your Appium test script, enter the URL for the application as the "app" desired capability. Below is an example Java snippet:

    desiredCapabilities.setCapability("app", "https://drive.google.com/uc?export=download&id=1balA7M1p4cM-JgGh6aKbuGiPE4bPStDK");


Using the Legacy Test Object Platform:

  1. Click New App to create your project.
  2. Click Install Remote, enter the name of your application, and click Save.
  3. In your Appium test script, enter the URL for the application as the "app" desired capability. Below is an example Java snippet:

    desiredCapabilities.setCapability("app", "https://drive.google.com/uc?export=download&id=1balA7M1p4cM-JgGh6aKbuGiPE4bPStDK");

Choosing a REST API

If you run Appium tests with your:

Sauce Labs CredentialsTest Object  Credentials

Please use the Sauce Labs Storage REST API (app.saucelabs.com

To retrieve your Sauce Labs credentials:

Please use the Legacy Real Device Cloud REST API (app.testobject.com)

To retrieve your Test Object credentials:

Below are some examples of how to use the Sauce Labs REST API to upload your mobile application to Sauce Storage. Please select your Sauce Labs Testing Platform whether you're using Test Object (Legacy) or the Sauce Labs Platform.

RDC on Sauce API

Currently only the Sauce Storage endpoint is supported for automated testing on real devices. Please use the endpoint below to upload your application to the Sauce Labs Storage:

US Data Center

curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST -w "%{http_code}\n" \
-H "Content-Type: application/octet-stream" \
https://app.saucelabs.com/rest/v1/storage/$SAUCE_USERNAME/app-debug.apk?overwrite=true \
--data-binary @app-debug.apk

EU Data Center

curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST -w "%{http_code}\n" \
-H "Content-Type: application/octet-stream" \
https://app.eu-central-1.saucelabs.com/rest/v1/storage/$SAUCE_USERNAME/app-debug.apk?overwrite=true \
--data-binary @app-debug.apk

Legacy Real Device API

US Data Center

curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \
https://app.testobject.com:443/api/storage/upload -H \
"Content-Type: application/octet-stream" --data-binary @your_app.apk

Useful Header Parameters

App-DisplayName

A custom display name for your app.

curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \
https://app.testobject.com:443/api/storage/upload -H \
"Content-Type: application/octet-stream" -H \
"App-DisplayName: yourCustomDisplayName" --data-binary @your_app.apk


App-Identifer

A custom identifier for your app.

curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \
https://app.testobject.com:443/api/storage/upload -H \
"Content-Type: application/octet-stream" -H \
"App-Identifier: identifier_for_your_app" --data-binary @your_app.apk

EU Data Center

curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \
https://app.testobject.com:443/api/storage/upload -H \
"Content-Type: application/octet-stream" --data-binary @your_app.apk

Useful Header Parameters

App-DisplayName

A custom display name for your app.

curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \
https://app.testobject.com:443/api/storage/upload -H \
"Content-Type: application/octet-stream" -H \
"App-DisplayName: yourCustomDisplayName" --data-binary @your_app.apk


App-Identifer

A custom identifier for your app.

curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST \
https://app.testobject.com:443/api/storage/upload -H \
"Content-Type: application/octet-stream" -H \
"App-Identifier: identifier_for_your_app" --data-binary @your_app.apk

Check if App Already Exists

You can use a custom app identifier to to check if an app was already uploaded.

First, get all the apps for a specified MD5:

curl -u "your_username:your_api_key" -X GET \
https://app.testobject.com:443/api/storage/app?appIdentifier=MD5_hash_of_your_app

If the call returns an empty JSON array, start uploading the file:

curl -u "your_username:your_api_key" -X POST \
https://app.testobject.com:443/api/storage/upload -H \
"Content-Type: application/octet-stream" -H \
"App-Identifier: MD5_hash_of_your_app" --data-binary @your_app.apk





HockeyApp EOL

Sauce Labs RDC will no longer support apps that exist in HockeyApp. Please read the following announcement for further details: HockeyApp End of Life: How to Prepare as well as the transition guide here: https://hockeyapp.net/faq/

Get API Token from App Center

To start the integration with TestObject, you need to get API token from App Center. 

Follow these steps to generate the API token:

  1. Sign in to your App Center account.

  2. Go to Account Settings > API Tokens.

  3. Select New API Token and name it.

  4. Give the the token 'Full Access' and your app role is manager or developer.

  5. Generate and copy the token.

  6. Make sure there are apps uploaded before you try to integrate with Test Object.

Sync Your Apps to Test Object 

Follow these steps to sync your apps in Test Object:

  1. Log into app.testobject.com.

  2. Create a new project/’App.’

  3. Select Auto-Update.

  4. Enter the API Token from App Center.