Skip to end of metadata
Go to start of metadata

You can upload the application you want to test to Sauce Storage using our REST API, and then access it for testing by specifying sauce-storage:myapp for the app capability in your test script. 

Uploading Other Test Assets to Sauce Storage

While uploading your mobile application to Sauce Storage or another accessible online location is a requirement for mobile application testing, you can also use Sauce Storage for other assets that you want to use in your tests, such as pre-run executables.

 

Sauce Storage is Private Temporary Storage

Sauce Storage is a private storage space, and after seven days, all assets are cleared from your it.  If it has been over seven days since your last tested your application in Sauce Storage, you will need to upload it again.

Upload Your App Using the REST API

iOS .app Applications Must be in a .zip File

If you create your iOS application as a .app directory with multiple files, you need to export it as a .zip file before uploading. If you have created your app as a .ipa file, you can upload that file directly without needing to zip it up.

You upload apps using  the  upload_file  method of the Sauce Labs REST API. You can use any REST client or cURL, as shown in these examples. 

Uploading with cURL

If you're using cURL for the upload, you must include the @ before path/to/your_file_name

OS X/Linux Example of Using cURL to Upload an App to Sauce Storage

curl -u <sauce_username>:<sauce_access_key> -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/<sauce_username>/<upload_filename>?overwrite=true --data-binary @<path/to/your_file_name>

Windows Example of Using cURL to Upload an App to Sauce Storage

curl -u <sauce_username>:<sauce_access_key> -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/<sauce_username>/<upload_filename>?overwrite=true --data-binary @/<path/to/your_file_name>

Parameters for the upload_file method

ParameterDescription
sauce_usernameYour Sauce Labs username
sauce_access_keyYour Sauce Labs access key
upload_filename

The name you want to use for the file under Sauce Storage, for example SuperApp.zip or myApp.apk.

This is the name you will refer to when you set the app, sauce-storage:myfilename capability in your test script, not the name of the file as it appears on your local system.
path/to/your_file_name

The path to where the file is saved on your local system, for example users/Tester/builds/super_app_tst_1228_build.zip

 

Set the Desired Capabilities of Your Test to Reference Your Application File in Sauce Storage

Sauce Storage URLs are in the form sauce-storage:<upload_filename>. After you've uploaded the file, you can set your test to reference the application at the Sauce Storage URL with the app capability, as shown in this example for Java.

DesiredCapabilities caps = DesiredCapabilities.iphone();
caps.setCapability("appiumVersion", "1.4.16");
caps.setCapability("deviceName","iPhone 6");
caps.setCapability("deviceOrientation", "portrait");
caps.setCapability("platformVersion","9.2");
caps.setCapability("platformName", "iOS");
caps.setCapability("browserName", "");
caps.setCapability("app","sauce-storage:myapp.zip");
  • No labels