Skip to main content

Application Setup

Continuous Testing Cloud provides additional application capabilities for your Appium based tests.

These capabilities give you better control over the state of the application before a tests is run.

NameDescription
appThe path to the application files to install and launch.



* Optional - To install cloud apps with unique name use this syntax: cloud:uniqueName=<value>



* To support an iOS app,  add the capability 'bundleId'.

* To support an Android app, add the 'appPackage' and the 'appActivity' capabilities.



You can use the API to upload an app to cloud with a unique name.
instrumentAppInstrument the application.



Default: false
noReset* Launch the application without killing it before (when the capabilities bundleID (iOS) or packageName+activityName (Android) are provided.

* Not kill or close the application on driver quit (when the capabilities bundleID (iOS) or packageName+activityName (Android) are provided.

* Stay on the application and not go to Home screen on driver.quit.

* Not clear application data (Android only).

* The application is not reinstalled no matter the versioning (it overrides the parameter installOnlyForUpdate**).**
fullResetUninstall the application completely before installing it again.



This is relevant only when the app capability specified.



Upon test completion, the application will be uninstalled (driver.quit()).



If this is used with noReset = true the application stays on the device at the end of the test (when app capability is provided).



If this is used with noReset = false the application is not uninstalled at the beginning, only at the end of the test (when app capability is not provided)



Default: false
applicationClearDataClears the application data. 



When noReset or fullReset is true, then applicationClearData has no effect.



Default: false
autoWebviewMoves application into web view context.
appBuildVersionSpecifies the application build version for installation. Used only when installing a cloud application.
appReleaseVersionSpecifies the application release version for installation. Used only when installing a cloud application.
installOnlyForUpdateInstall the application only if the desired version is different from the application version on the device (or if the app does not exist on the device). Otherwise, keep the application on the device.



That will greatly improve session creation time for testings on the same application version



The following desired capability must also be specified if using this feature:



* At least one of 2 new capabilities have to be provided "appReleaseVersion" or "appBuildVersion" (formally appVersion), then



* If only "appReleaseVersion" is provided, the application is not installed if there is an application with same release version is installed on device.



* If only "appBuildVersion" (formally appVersion) is provided, the application is not installed if there is an application with same build version is installed on device.



* If both "appReleaseVersion" and "appBuildVersion" (formally appVersion) are provided, the application is not installed if there is an application with same release version and  build version is installed on device.



* When neither "appReleaseVersion" nor "appBuildVersion" (formally appVersion) is provided for application, the application is not installed and an exception is thrown.



* 'bundleId' for iOS only

* 'appPackage' and 'appActivity' for Android only



The installation of the package on the device will happen in the following cases:



* If the application is already installed on the device and the version different than the one specified by appBuildVersion and/or appReleaseVersion. the desired version is installed.

* If noReset  is true, this overrides the version check and follows the behavior of noReset.

* If fullReset is true, this overrides the version check and follows the behavior of fullReset.







iOS Example



<br/><br/>dc.setCapability(MobileCapabilityType.APP, "cloud:com.experitest.ExperiBank");<br/><br/>dc.setCapability(IOSMobileCapabilityType.BUNDLE_ID, "com.experitest.ExperiBank");<br/><br/>dc.setCapability("appBuildVersion", "2.23");<br/><br/>dc.setCapability("installOnlyForUpdate", true);<br/><br/>



Android Example



<br/><br/>dc.setCapability(MobileCapabilityType.APP, "cloud:com.experitest.ExperiBank/.LoginActivity");<br/><br/>dc.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, "com.experitest.ExperiBank");<br/><br/>dc.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, ".LoginActivity");<br/><br/>dc.setCapability("appBuildVersion", "4352");<br/><br/>dc.setCapability("appReleaseVersion", "1.01");<br/><br/>dc.setCapability("installOnlyForUpdate", true);<br/><br/>
dontGoHomeOnQuitThe device  will remain in last left state even after ending the test



Default: false

iOS Only

NameDescription
<br/><br/>bundleId<br/><br/><br/><br/>iOS application identifier<br/><br/>

Java

// iOS - launch pre-installed application and switch context automatically into webview
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability(MobileCapabilityType.APP, "cloud:com.experitest.ExperiBank");
dc.setCapability(MobileCapabilityType.AUTO_WEBVIEW, true);
driver = new IOSDriver<>('<server>', dc);

Python

dc = {}

....
....

self.dc['platformName'] = 'ios'
self.dc['app'] = 'cloud:com.experitest.ExperiBank'
self.dc['autoWebview'] = True

self.driver = webdriver.Remote('<server>', self.dc)

C Sharp

// iOS - launch pre-installed application and switch context automatically into webview
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability(MobileCapabilityType.App, "cloud:com.experitest.ExperiBank");
dc.SetCapability(MobileCapabilityType.AutoWebView, true);
driver = new IOSDriver<>('<server>', dc);
info

Replace <server> with the appropriate URL.

Android Only

NameDescription
<br/><br/>noReset<br/><br/>Don't reset app state before this session.



Default false.
<br/><br/>appPackage<br/><br/>Package name of the activity for launch
<br/><br/>appActivity<br/><br/>Activity name to launch
autoGrantPermissionsGrants permissions required by the application on install. This does not work on Android 12.

Java

// Install Android application from path and launch it on the device
// You'll need to upload the application to the cloud as a prerequisite

DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability(MobileCapabilityType.APP, "cloud:com.experitest.eribank/com.experitest.ExperiBank.LoginActivity");
dc.setCapability("instrumentApp", true);
dc.setCapability(MobileCapabilityType.FULL_RESET, true);
dc.setCapability("dontGoHomeOnQuit", true);
driver = new AndroidDriver<>('<server>', dc);

Python

dc = {}


....
....

self.dc['platformName'] = 'android'
self.dc['app'] = 'cloud:com.experitest.eribank/com.experitest.ExperiBank.LoginActivity'
self.dc['instrumentApp'] = True
self.dc['fullReset'] = True
self.dc['dontGoHomeOnQuit'] = True
self.driver = webdriver.Remote('<server>', self.dc)

C Sharp

// Install Android application from path and launch it on the device
DesiredCapabilities dc = new DesiredCapabilities();
dc.SetCapability(MobileCapabilityType.App, "cloud:com.experitest.eribank/com.experitest.ExperiBank.LoginActivity");
dc.SetCapability("instrumentApp", true);
dc.SetCapability(MobileCapabilityType.FullReset, true);
dc.SetCapability("dontGoHomeOnQuit", true);
driver = new AndroidDriver<>('<server>', dc);

Start Test Without Launching An Application

In order to start the test, omit the app capability and the application ID capabilities (bundleId/appPackage + appActivity).

Java

DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver<>('<server>', dc);

Python

dc = {}
self.dc['platformName'] = 'android'
self.driver = webdriver.Remote('<server>', self.dc)

C Sharp

DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver<>('<server>', dc);