Supported Appium capabilities

Use capabilities to select the device, start applications, and control the Perfecto Appium server. For additional information, see Define capabilities.

For information related to simulators and emulators, see Supported capabilities for virtual mobile devices.

Important: For desired capabilities to work with the latest Appium client, make sure to prefix Appium capabilities with appium: and Perfecto capabilities with perfecto:.

Mandatory capabilities

The following code snippets include the capabilities mandatory to start an Appium session with Perfecto.

Copy

Desktop web (Windows)

platformName: Windows
platformVersion: (Specify the required Windows version, such as 10 or 11)
browserName: (Chrome, Firefox, Edge)
browserVersion: (Specify version if needed)
resolution: (Such as 1920x1080)
securityToken: (Your Perfecto user's securityToken)
Copy

Desktop web (macOS)

platformName: Mac
platformVersion: (Specify macOS version, such as Monterey, Ventura)
browserName: (Safari, Chrome, Firefox)
browserVersion: (Specify version if needed)
resolution: (Such as 1920x1080)
securityToken: (Your Perfecto user's securityToken)
Copy

iOS web testing

platformName: iOS
platformVersion: (Specify iOS version, such as 16.x)
deviceName: (Specify device, such as iPhone 14)
browserName: Safari
automationName: XCUITest
securityToken: (Your Perfecto user's securityToken)
Copy

iOS native app testing

platformName: iOS
platformVersion: (Specify iOS version)
deviceName: (Specify device, such as iPhone 14)
app: (path/to/app.ipa or App ID from Perfecto repository)
automationName: XCUITest
bundleId: (Required for installed apps)
securityToken: (Your Perfecto user's securityToken)
Copy

Android web testing (real & virtual devices)

platformName: Android
platformVersion: (Specify Android version, such as 13.0)
deviceName: (Specify device or use * for any available device)
browserName: Chrome
automationName: UiAutomator2
securityToken: (Your Perfecto user's securityToken)
Copy

Android native app testing (real & virtual devices)

platformName: Android
platformVersion: (Specify Android version)
deviceName: (Specify device or use *)
app: (path/to/app.apk or App ID from the Perfecto repository)
automationName: UiAutomator2
appPackage: (Required for installed apps)
securityToken: (Your Perfecto user's securityToken)
Copy

Additional optional capabilities

location: (Specify location if needed for geolocation testing)
networkProfile: (Set network conditions if required)
recordVideo: true or false (Enable/disable test video recording)
screenshotOnFailure: true or false (Capture screenshots on failure)
securityToken: (Your Perfecto user's securityToken)

Feature-based device selection

To select a device with specific features, see Select a device based on supported features.

General capabilities

Capability Value Description Use cases

app


Specifies the Perfecto repository path to an IPA (for iOS) or an APK, APKS, or AAB file (for Android). For virtual devices, this is a ZIP file (for iOS) or an APK or APKS file (for Android).

Incompatible with browserName.

Native and hybrid apps on real and virtual mobile devices (iOS and Android)

autoAcceptAlerts

true | false

iOS only. Specifies whether to allow alerts automatically during your test session. Set the value according to your test requirements.

Native and hybrid apps on real and virtual mobile devices (iOS)

autoDismissAlerts

true | false (default)

iOS only. Specifies whether to dismiss alerts automatically during your test session, including privacy access permission alerts. Turned off by default.

Native and hybrid apps on real and virtual mobile devices (iOS)

autoGrantPermissions

true | false (default)

Android only. Specifies whether to automatically grant all the permissions that an Android app requests upon installation.

Native and hybrid apps on real and virtual mobile devices (Android)

autoLaunch

true (default) | false

Specifies whether to have Appium install and launch the app automatically.

Native and hybrid apps on and virtual mobile devices (iOS/Android)

automationName*

Appium (default)| XCUITest | PerfectoMobile

Specifies the automation engine to use. Determines the UIElement Class names identified by the automation engine.

With Appium 2.4.1 (available in Perfecto hybrid and enterprise clouds as of June 30, 2024), you can set this capability to one of the following values:

  • Appium (as shown in the following code example)

    Perfecto will replace this value internally with the relevant platform-specific value.

  • XCUITest (for iOS)

  • UIAutomator2 (for Android)

With Appium 1.22.3, this capability is optional. If not set and the device is running a non-iOS OS, the Appium infrastructure will be used. Use PerfectoMobile for the Perfecto object tree (uses generic UIElement classes). You can also use a value of Appium. Not relevant for virtual devices.

Appium Java client 8 uses a direct connection to the Appium server and therefore cannot work with the following capability: ("automationName", "PerfectoMobile");

With Java client 8 or later, you must add the prefix perfecto: to any non-Appium desired capability.

Native and hybrid apps on real and virtual mobile devices (iOS and Android)

browserName

Chrome | Safari | MobileOS | MobileDefault

Specifies the name of the mobile web browser to automate.

For application testing, use an empty string or omit the capability.

Mobile web apps on real and virtual mobile (iOS and Android)

Desktop web apps (Windows and Mac)

fullReset

true | false (default)

Resets the app state by uninstalling the app. This will also remove the app after the session is complete.

Important: To achieve the desired outcome, be aware that the Perfecto extension dataReset takes precedence over fullReset. The current behavior is as follows:
  • If dataReset = true (default) and fullReset = false (default), the app is uninstalled.

  • If dataReset = true (default) and fullReset = true, the app is uninstalled.

  • If dataReset = false and fullReset = false (default), the app is not uninstalled.

  • If dataReset = false and fullReset = true, the app is not uninstalled.

Native and hybrid apps on real and virtual mobile devices (iOS and Android)

noReset

true | false (default)

Specifies that the app state should not be reset before this session.

Native and hybrid apps on real and virtual mobile devices (iOS and Android)

orientation

LANDSCAPE | PORTRAIT

Starts the device in a certain orientation.

Native, hybrid, and mobile web apps on real and virtual mobile devices (iOS and Android)

skipLogCapture

true (default) | false

Specifies whether Appium should skip capturing logs during the test execution. By default, this functionality is disabled to manage performance on Perfecto servers. If you need Appium to capture logs by setting the value of this capability to false, consider that this functionality:

  • Is only supported with Appium 2

  • Requires the use of a World Wide Web Consortium (W3C) compliant client (such as Java client 8+, DotNet client 5+, or Python client 3+)

Native, hybrid, and mobile web apps on real and virtual mobile devices (iOS and Android)

udid


Specifies the unique device identifier of the connected physical device. Not relevant for virtual devices.

Native, hybrid, mobile web apps on real mobile devices (iOS and Android)

* Mandatory

Perfecto extensions

General capabilities

Capability Value Description Use case

appiumVersion

Java.String object

Specifies which Appium version to use when initializing a device. You can also switch between versions using a capability provided to start the session.

A version number is only valid if it is supported by Perfecto (such as 1.22.3 or, as of June 30, 2024, 2.4.1).

If you work with an Appium 2-compliant client, you also need to provide the automationVersion capability. In this case, automationVersion overrides the appiumVersion.

To use this capability, include the following in your tests:

Copy
capabilities.setCapability("enableAppiumBehavior", true); // Mandatory
capabilities.setCapability("appiumVersion", appiumVersion);

where the second parameter is of type Java.String object.

Copy
Example 1
capabilities.setCapability("appiumVersion", "latest"); // To use the latest Appium version installed on the HSS
Copy
Example 2
capabilities.setCapability("appiumVersion", "1.22.3"); // To use a specific Appium version even when older than the default
Important: To swap versions during test execution, the script should include the following code before creating a new driver with a new set of capabilities (that include the different requested Appium version):
Copy
{noformat}driver.quit();{noformat}

Native, hybrid, and mobile web apps on real and virtual devices

Desktop web apps (Windows and Mac)

autoInstrument

true | false (default)

When set to true, instruments the iOS or Android application before it is installed.

Required for certain hybrid app instrumentation or advanced element tracking.

To work with hybrid applications, install the iOS/Android application as instrumented.

Native, hybrid, and mobile web apps on real devices (Android and iOS)

dataReset

true (default) | false

When re-installing an application, specifies whether all data associated with the application should be deleted and the application will start with a clean slate. When set to false, data is not deleted and the updated application continues in the context of the existing data.

Native and hybrid apps on real devices (Android and iOS)

enableAppiumBehavior

true (default) | false

(Android only) Controls the Appium architecture used. See also useAppiumForWeb.

For details, see Driver-based Appium architecture for testing on Android and Driver-based Appium architecture for testing on iOS.

Native, hybrid, and mobile web apps on real devices (Android)

geoLocation

ArgentinaAustralia | Austria | Belgium | Brazil | Bulgaria | Canada | CA-British Columbia | CA-Ontario| CA-Quebec | China | Colombia | Croatia | Cyprus | Czechia | Denmark | Dominican Republic | Estonia | Finland | France |Germany | Greece | Hungary | India | Indonesia | Ireland | Italy | Japan | Latvia | Lithuania | Luxembourg | Mexico | Netherlands | Norway | Peru | Poland | Romania | Portugal | S. Africa | S. Korea | Slovakia | Slovenia | Spain | Sweden | Switzerland | Turkey |UK | US-California | US-Colorado | US-East | US-Utah | US-Virginia| US-West

Simulates the geolocation (the physical location of the device) used for testing the application. This is helpful when your app provides different services or content based on a user's location in the world. For more information, see IP Geolocation testing.

Native, hybrid, and mobile web aps on real devices (Android and iOS)

scriptName


Sets the script report and report folder names.

The script name should not include a blank character.

Native, hybrid, and mobile web apps on real and virtual devices

screenshotOnError

true | false (default)

Specifies whether to generate screenshots for the report only for error conditions. This capability takes priority over the takesScreenshot capability.

Native, hybrid, mobile web apps on real and virtual devices

sensorInstrument

true | false (default)

Specifies whether to instrument the iOS or Android application before installing. Instrumentation is required if you need to work with sensor input (for example fingerprint simulation or image injection).

Native and hybrid apps on real and virtual devices

takesScreenshot

true (default) | false

Takes screenshots to display in the report. Relevant only if screenshotOnError is false.

Native, hybrid, and mobile web apps on real and virtual devices

useAppiumForWeb

true | false

Sets the flow for using objects in Safari/Chrome to match Appium's precise flow. Works in tandem with the enableAppiumBehavior capability.

For details, see Driver-based Appium architecture for testing on Android and Driver-based Appium architecture for testing on iOS.

Native, hybrid, and mobile web apps on real and virtual devices

waitForPageLoad

true | false (default)

Indicates whether the driver.get(url) method of Selenium returns synchronously, that is only after the page is loaded, or asynchronously (default), i.e. immediately after sending the request and before the page is actually loaded in the browser.

Hybrid or mobile web apps or hybrid on real devices (iOS an Android)

Appium 2 capabilities

Going forward, the internal driver version will be used to configure Appium, as shown in the following table.

For migration information, see the Appium documentation: Migrating to Appium 2.x from Appium 1.x

Capability Value Description Use case

automationVersion

iOS:

3.59.0| 6.1.0

Android:

1.70.1 | 2.45.1

Determines which version of the specified driver should be used. If this capability is set, it overrides the appiumVersion capability.

For iOS:

  • Appium 2.4.1 has internal driver version 6.1.0 (available in Perfecto hybrid and enterprise clouds as of June 30, 2024).

  • Appium 1.22.3 has internal driver version 3.59.0.

For Android:

  • Appium 2.4.1 has internal driver version 2.45.1 (available in Perfecto hybrid and enterprise clouds as of June 30, 2024).

  • Appium 1.22.3 has internal driver version 1.70.1.

Real devices only

Android

Capability Value Description Use case

appActivity


Specifies the activity name for the Android activity you want to launch from your package. This often needs to be preceded by a . (for example, .MainActivity instead ofMainActivity)

Native or hybrid apps on real or virtual devices (Android)

appPackage


Specifies the Java package of the Android app you want to run

Native or hybrid apps on real or virtual devices (Android)

appWaitActivity


Specifies the activity name for the Android activity you want to wait for

Native or hybrid apps on real or virtual devices (Android)

appWaitPackage


Specifies the Java package of the Android app you want to wait for

Native or hybrid apps on real or virtual devices (Android)

intentAction

default: android.intent.action.MAIN

Specifies the intent action that will be used to start an activity

Native apps on real or virtual devices (Android)

intentCategory

default: android.intent.category.LAUNCHER

Specifies the intent category that will be used to start an activity

Native apps on real or virtual devices (Android)

intentFlags

default: 0x10200000

Specifies the flags that will be used to start activity

Native apps on real or virtual devices (Android)

optionalIntentArguments


Specifies additional intent arguments that will be used to start an activity.

Native apps on real or virtual devices (Android)

securedScreenInstrument

true | false (default)

When set to true, turns on instrumentation of secured screens on devices running Android 12 and later. In this case, calls on the app that use FLAG_SECURE will be removed (only setFlags() and addFlags() methods that use FLAG_SECURE are affected), and secured screens will be visible in the installed app.

Native apps on real or virtual devices (Android version 12 or later with FLAG_SECURE set)

iOS 

Capability Value Description

Use case

bundleId


Bundle ID of the app under test. Useful for starting an app on a real device or for using other caps which require the bundle ID during test startup

Native or hybrid apps on real or virtual devices (iOS)

processArguments


Arguments to pass to the AUT using instruments

Native, hybrid, and web mobile apps on real and virtual devices (iOS)

language


Sets the iOS device language for the duration of the script

Native and hybrid apps on real and virtual devices (iOS)

locale


Sets the iOS device region settings for the duration of the script

Native and hybrid apps on real and virtual devices (iOS)

Important: Both language and locale expect a ‘locale identifier’ as a value. These capabilities are applicable to iOS devices that support the XCUITest framework.

Appium open source capabilities

In addition,Perfectosupports the list of Appium server capabilities. To reference these, see the Appium documentation.