Skip to end of metadata
Go to start of metadata

Mobile Native Application Test Configuration Tips

Setting appiumVerion

If you omit the appiumVersion in your test configuration, your test will be running with our default Appium version. Sauce recommends that you specify one of the newer Appium versions that provides a more extended API and fixes to known bugs. 

Checking the Appium Version for Your Test

  1. Log in to saucelabs.com.
  2. Find and select the test that you ran using Appium to view the Test Details page.
  3. Click the Metadata tab.
  4. Look for the Logs row and select Appium Log.
    The first line should indicate the Appium version. For example, 2014-05-05T17:45:07.541Z - info: Welcome to Appium v1.3.6.

Setting Browser Name

 When testing a native mobile application, the value for browserName is an empty string, as in caps.setCapability("browserName"""); 

Setting the Location of the Mobile App

If the application you want to test has been uploaded to a location other than Sauce Storage, you need to specify this location for app, and make sure that this location is accessible to Sauce Labs browsers. For example, caps.setCapability("app","sauce-storage:mapp.zip");

Setting automationName for Android Apps

If you're testing a native mobile app against Android versions 4.0 - 4.1, or a hybrid mobile against Android versions 4.0 - 4.2, you need to set the capability "automationName","selendroid". These Android versions are only supported via Appium’s bundled version of Selendroid, which utilizes Instrumentation. Later versions of Android are supported via Appium’s own UiAutomator library.

Examples of Native and Hybrid Mobile Application Test Configuration for Emulators and Simulators

iPhone Native Application

DesiredCapabilities caps = DesiredCapabilities.iphone();
caps.setCapability("appiumVersion", "1.4.16");
caps.setCapability("deviceName","iPhone 5");
caps.setCapability("deviceOrientation", "portrait");
caps.setCapability("platformVersion","8.4");
caps.setCapability("platformName", "iOS");
caps.setCapability("browserName", "");
caps.setCapability("app","sauce-storage:mapp.zip");

iPad Native Application

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

iPhone Hybrid Application

DesiredCapabilities caps = DesiredCapabilities.iphone();
caps.setCapability("appiumVersion", "1.4.16");
caps.setCapability("deviceName","iPhone Retina (4-inch 64-bit)");
caps.setCapability("deviceOrientation", "portrait");
caps.setCapability("platformVersion","7.1");
caps.setCapability("platformName", "iOS");
caps.setCapability("browserName", "");
caps.setCapability("app","sauce-storage:myapp.zip");

Android Native Application, Android v. 4.3

DesiredCapabilities caps = DesiredCapabilities.android();
caps.setCapability("appiumVersion", "1.4.16");
caps.setCapability("deviceName","Samsung Galaxy S4 Emulator");
caps.setCapability("deviceOrientation", "portrait");
caps.setCapability("browserName", "");
caps.setCapability("platformVersion","4.3");
caps.setCapability("platformName","Android");
caps.setCapability("app","sauce-storage:myapp.zip");

Android Hybrid Application, Android v. 4.1

DesiredCapabilities caps = DesiredCapabilities.android();
caps.setCapability("appiumVersion", "1.4.16");
caps.setCapability("deviceName","Android Emulator");
caps.setCapability("deviceType","tablet");
caps.setCapability("deviceOrientation", "portrait");
caps.setCapability("browserName", "");
caps.setCapability("platformVersion","4.1");
caps.setCapability("platformName","Android");
caps.setCapability("app","sauce-storage:myapp.zip");
caps.setCapability("automationName","Selendroid");

Examples of Native and Hybrid Mobile Application Test Configuration for Real Devices

iPhone 6 Real Device

{
deviceName:'iPhone 6 Device',
platformName:'iOS',
platformVersion:'8.4',
app:'sauce-storage:SampleIOSApp.ipa',
"appium-version":"1.4.16"
}

Samsung Galaxy S5 Real Device

{
deviceName:'Samsung Galaxy S5 Device',
platformVersion:'4.4',
platformName:'Android',
"appActivity": ".ContactManager",
"appPackage": "com.example.android.contactmanager",
app:"http://saucelabs.com/example_files/ContactManager.apk",
"appium-version":"1.4.16"
}

Samsung Galaxy S4

{
deviceName:'Samsung Galaxy S4 Device',
platformVersion:'4.4',
platformName:'Android',
"appActivity": ".ContactManager",
"appPackage": "com.example.android.contactmanager",
app:"http://saucelabs.com/example_files/ContactManager.apk",
"appium-version":"1.4.16"
}