Set Desired Capabilities

Desired Capabilities allow you to indicate important parameters. These parameters tell the Appium Server how you want your test sessions to behave. When you connect a mobile device, emulator, or simulator to your workstation, Tricentis Tosca uses a default collection of Desired Capabilities to communicate with the Appium Server.

If you need to use custom Desired Capabilities, you can specify them when you scan your mobile application with the Mobile Scan and when you execute your TestCases. This chapter describes how to:

For a list of all supported Desired Capabilities, see the Appium Documentation and WebDriverAgent Documentation.

Set Desired Capabilities for a scan

You can set Desired Capabilities to specify connection parameters during the scan of a mobile device, emulator, or simulator.

To do so, follow these steps:

  1. Start the Mobile Scan.

  2. Click Advanced configuration.

Advanced configuration button in the Mobile Scan window

  1. Select Add Capabilities Set. You can define one or more capabilities sets.

  2. Define a name for the new capabilities set on the left side of the window.

  3. Select Add Capability for each Desired Capability that you want to add to the selected capabilities set.

  4. Enter the name of each Desired Capability and the required value into the Value column.

Desired Capabilities in the Advanced configuration window

  1. Click Add and continue the scan.

Set Desired Capabilities for test execution

You can also apply Desired Capabilities to your test execution.

Use the Set Desired Capabilities Module to define which Desired Capabilities you want to use.

This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Mobile.

To apply Desired Capabilities to your test execution, follow the steps below:

  1. Specify the test configuration parameters to establish a connection with the device.

  2. Drag and drop the Set Desired Capabilities Module onto your TestCase. It must be the first TestStep of your TestCase.

  3. Enter the name of a Desired Capability into the Name column.

  4. Enter the required value of the Desired Capability into the Value Column.

  5. Set the ActionMode to Select.

  6. If you create Desired Capabilities to fetch key vaults, set the DataType to Secret.

  7. Add either the Open Mobile App TestStep or the OpenUrl TestStep as a first TestStep in the execution.

In this example, you apply the Desired Capabilities skipServerInstallation and skipDeviceInitialization to reduce the startup time of Android test execution.

Set Desired Capabilities Module in a TestCase

Use Desired Capabilities to reduce startup time

You can use Desired Capabilities to reduce the startup time of the Appium Server. The table below lists the Desired Capabilities that you can apply for a scan or for test execution on Android or iOS devices.

Desired Capability

Android

iOS

Description

noSign

Responsible for checking and signing the app with debug keys.

The default value is False.

Set this Desired Capability to True to reduce startup time. Use it only with UiAutomator.

skipDeviceInitialization

Skips device initialization that includes, for example, installation and running the settings app or permission settings.

The default value is False.

If you have already used the mobile device for test automation and it is prepared for the next automation, set this Desired Capability to True to improve startup performance.

Use this Desired Capability from Appium version 1.12.0.

skipServerInstallation

Skips the installation of UiAutomator2 and uses uiAutomator2 from the device.

The default value is False.

Set this Desired Capability to True to reduce startup time when an UiAutomator2 server in proper version is already installed on your device (i.e. a version compatible with the installed Appium Server).

Use this Desired Capability from Appium version 1.12.0.

skipUnlock

Skips unlocking of the mobile screen.

The default value is False.

If you are sure that the screen of the mobile device is unlocked, you can set this Desired Capability to True to reduce the Appium startup time.

useNewWDA

Uninstalls an existing WebDriverAgent app from the device. If set to True, this Desired Capability enables you to apply different WebDriverAgent startup options at the beginning of each session.

The default value is True.

Set this Desired Capability to False to reduce startup time.

usePrebuiltWDA

Skips building the WebDriverAgent app when running the application. If enabled, you must build the app yourself. This Desired Capability works only with Xcode 8 or later.

The default value is False.

Set this Desired Capability to True to reduce startup time.

For a list of all supported Desired Capabilities, see the Appium Documentation and WebDriverAgent Documentation.

Use Desired Capabilities to fetch secrets from a key vault

When you scan mobile applications on a cloud, you can use a key vault provider to access confidential data. To fetch these secrets from a key vault, you must set Desired Capabilities. The table below lists the Desired Capabilities that you can apply for a scan or for test execution on Android and iOS devices.

Desired Capability

Description

securityToken

Define a dynamic expression to fetch secrets from your key vault. The Syntax is: {SECRET[<SecretPath>][<FieldName>]}.

  • The parameter SecretPath specifies the path to the secret inside the key vault.

  • The parameter FieldName specifies which field from the secret to fetch.

KeyVaultPath

Set the path to the key vault provider executable file.