Appium
getLogTypes
Get available log types.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.getLogTypes()
Returns
- <String[]>
logTypes: The list of available log types, example: browser, driver.
getLogs
Get the log for a given log type. Log buffer is reset after each request.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.getLogs(type)
Parameters
| Name | Type | Details |
|---|---|---|
type | string | the log type |
Returns
- <Object[]>
logs: The list of log entries.
getSession
Retrieve the capabilities of the current session.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use getAppiumSessionCapabilities instead
Usage
await driver.getSession()
Returns
- <Object>
capabilities: An object describing the session's capabilities.
getAppiumContext
Appium command. More details can be found in the official protocol docs.
Usage
await driver.getAppiumContext()
Returns
- <Context>
context: a string representing the current context or null representing 'no context'
switchAppiumContext
Appium command. More details can be found in the official protocol docs.
Usage
await driver.switchAppiumContext(name)
Parameters
| Name | Type | Details |
|---|---|---|
name | string | a string representing an available context |
getAppiumContexts
Appium command. More details can be found in the official protocol docs.
Usage
await driver.getAppiumContexts()
Returns
- <Context[]>
contexts: an array of strings representing available contexts, e.g. 'WEBVIEW', or 'NATIVE'
getAppiumCommands
Retrieve the endpoints and BiDi commands supported in the current session.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.getAppiumCommands()
Returns
- <Object>
commands: Supported endpoints and BiDi commands, each grouped into common, driver-specific, and plugin-specific endpoints/commands.
getAppiumExtensions
Retrieve the extension commands supported in the current session.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.getAppiumExtensions()
Returns
- <Object>
commands: Supported extension commands, grouped into driver-specific and plugin-specific commands.
getAppiumSessionCapabilities
Retrieve the capabilities of the current session.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.getAppiumSessionCapabilities()
Returns
- <Object>
capabilities: An object describing the session's capabilities.
appiumShake
Perform a shake action on the device. This is the raw Appium protocol endpoint. Prefer the shake mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the shake mobile command (driver.shake()) instead
Usage
await driver.appiumShake()
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
appiumLock
Lock the device. This is the raw Appium protocol endpoint. Prefer the lock mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the lock mobile command (driver.lock()) instead
Usage
await driver.appiumLock(seconds)
Parameters
| Name | Type | Details |
|---|---|---|
secondsoptional | number | how long to lock the screen (iOS only) |
Support
- iOS: UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
- Windows: Windows (10+)
appiumUnlock
Unlock the device. This is the raw Appium protocol endpoint. Prefer the unlock mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the unlock mobile command (driver.unlock()) instead
Usage
await driver.appiumUnlock()
Support
- Android: UiAutomator (4.2+)
- Windows: Windows (10+)
appiumIsLocked
Check whether the device is locked or not. This is the raw Appium protocol endpoint. Prefer the isLocked mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the isLocked mobile command (driver.isLocked()) instead
Usage
await driver.appiumIsLocked()
Returns
- <boolean>
isLocked: True if the device is locked, false if not
Support
- Android: UiAutomator (4.2+)
- Windows: Windows (10+)
startRecordingScreen
Start recording the screen.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.startRecordingScreen(options)
Parameters
| Name | Type | Details |
|---|---|---|
optionsoptional | object | command parameters that can contain keys like: remotePath, username, password, method, forceRestart, timeLimit, videoType, videoQuality, videoFps, bitRate, videoSize, bugReport (see more description in Appium docs) |
Support
- iOS: XCUITest (9.3+)
- Android: UiAutomator (4.2+)
- Windows: Windows (10+)
stopRecordingScreen
Stop recording screen.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.stopRecordingScreen(remotePath, username, password, method)
Parameters
| Name | Type | Details |
|---|---|---|
remotePathoptional | string | The path to the remote location, where the resulting video should be uploaded. The following protocols are supported http/https, ftp. This option only has an effect if there is screen recording process in progreess and forceRestart parameter is not set to true. Null or empty string value (the default setting) means the content of resulting file should be encoded as Base64. |
usernameoptional | string | The name of the user for the remote authentication. |
passwordoptional | string | The password for the remote authentication. |
methodoptional | string | The http multipart upload method name. The 'PUT' one is used by default. |
Returns
- <string>
response: Base64 encoded string. If remote_path is set, the response is empty string
Support
- iOS: XCUITest (9.3+)
- Android: UiAutomator (4.2+)
- Windows: Windows (10+)
appiumGetPerformanceDataTypes
Returns the information types of the system state which is supported to read as like cpu, memory, network traffic, and battery. This is the raw Appium protocol endpoint. Prefer the getPerformanceDataTypes mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the getPerformanceDataTypes mobile command (driver.getPerformanceDataTypes()) instead
Usage
await driver.appiumGetPerformanceDataTypes()
Returns
- <string[]>
performanceTypes: The available performance data types (cpuinfo|batteryinfo|networkinfo|memoryinfo)
Support
- Android: UiAutomator (4.2+)
appiumGetPerformanceData
Returns the information of the system state which is supported to read as like cpu, memory, network traffic, and battery. This is the raw Appium protocol endpoint. Prefer the getPerformanceData mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the getPerformanceData mobile command (driver.getPerformanceData()) instead
Usage
await driver.appiumGetPerformanceData(packageName, dataType, dataReadTimeout)
Parameters
| Name | Type | Details |
|---|---|---|
packageName | string | the package name of the application |
dataType | string | the type of system state which wants to read. It should be one of the supported performance data types |
dataReadTimeoutoptional | number | the number of attempts to read |
Returns
- <string[]>
performanceData: The information type of the system state which is supported to read as like cpu, memory, network traffic, and battery
Support
- Android: UiAutomator (4.2+)
appiumPressKeyCode
Press a particular key on the device. This is the raw Appium protocol endpoint. Prefer the pressKeyCode mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the pressKeyCode mobile command (driver.pressKeyCode()) instead
Usage
await driver.appiumPressKeyCode(keycode, metastate, flags)
Parameters
| Name | Type | Details |
|---|---|---|
keycode | number | keycode to press |
metastateoptional | number | meta state to press the keycode with |
flagsoptional | number | flags for the keypress |
Support
- Android: UiAutomator (4.2+)
appiumLongPressKeyCode
Press and hold a particular key code on the device. This is the raw Appium protocol endpoint. Prefer the longPressKeyCode mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the longPressKeyCode mobile command (driver.longPressKeyCode()) instead
Usage
await driver.appiumLongPressKeyCode(keycode, metastate, flags)
Parameters
| Name | Type | Details |
|---|---|---|
keycode | number | keycode to press on the device |
metastateoptional | number | metastate for the keypress |
flagsoptional | number | flags for the keypress |
Support
- Android: UiAutomator (4.2+)
appiumSendKeyEvent
Send a key code to the device. This is the raw Appium protocol endpoint. Prefer the pressKeyCode mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the pressKeyCode mobile command (driver.pressKeyCode()) instead
Usage
await driver.appiumSendKeyEvent(keycode, metastate)
Parameters
| Name | Type | Details |
|---|---|---|
keycode | string | keycode to press |
metastateoptional | string | meta state to press the keycode with |
Support
- Android: UiAutomator (4.2+)
rotateDevice
Rotate the device in three dimensions.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.rotateDevice(x, y, z)
Parameters
| Name | Type | Details |
|---|---|---|
x | number | x offset to use for the center of the rotate gesture |
y | number | y offset to use for the center of the rotate gesture |
z | number | z offset to use for the center of the rotate gesture |
Support
- iOS: UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
appiumGetCurrentActivity
Get the name of the current Android activity. This is the raw Appium protocol endpoint. Prefer the getCurrentActivity mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the getCurrentActivity mobile command (driver.getCurrentActivity()) instead
Usage
await driver.appiumGetCurrentActivity()
Returns
- <string>
activity: Name of the current activity
Support
- Android: UiAutomator (4.2+)
appiumGetCurrentPackage
Get the name of the current Android package. This is the raw Appium protocol endpoint. Prefer the getCurrentPackage mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the getCurrentPackage mobile command (driver.getCurrentPackage()) instead
Usage
await driver.appiumGetCurrentPackage()
Returns
- <string>
package: Name of the current package
Support
- Android: UiAutomator (4.2+)
installApp
Install the given app onto the device.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.installApp(appPath, options)
Parameters
| Name | Type | Details |
|---|---|---|
appPath | string | Path to application .apk file |
optionsoptional | object | Driver-specific installation options |
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
activateApp
Activate the given app on the device
Appium command. More details can be found in the official protocol docs.
Usage
await driver.activateApp(appId, bundleId, options)
Parameters
| Name | Type | Details |
|---|---|---|
appIdoptional | string | App package ID (required for Android) |
bundleIdoptional | string | Bundle ID (required for iOS) |
optionsoptional | object | Driver-specific launch options |
Support
- iOS: XCUITest (9.3+)
- Android: UiAutomator (4.2+)
removeApp
Remove an app from the device.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.removeApp(appId, bundleId, options)
Parameters
| Name | Type | Details |
|---|---|---|
appIdoptional | string | App package ID (required for Android) |
bundleIdoptional | string | Bundle ID (required for iOS) |
optionsoptional | object | Driver-specific uninstall options |
Returns
- <boolean>
didRemovalSucceed: Return true if uninstall was successful, false if not
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
terminateApp
Terminate the given app on the device
Appium command. More details can be found in the official protocol docs.
Usage
await driver.terminateApp(appId, bundleId, options)
Parameters
| Name | Type | Details |
|---|---|---|
appIdoptional | string | App package ID (required for Android) |
bundleIdoptional | string | Bundle ID (required for iOS) |
optionsoptional | object | Driver-specific termination options |
Support
- iOS: XCUITest (9.3+)
- Android: UiAutomator (4.2+)
isAppInstalled
Check whether the specified app is installed on the device.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.isAppInstalled(appId, bundleId)
Parameters
| Name | Type | Details |
|---|---|---|
appIdoptional | string | App package ID (required for Android) |
bundleIdoptional | string | Bundle ID (required for iOS) |
Returns
- <boolean>
isAppInstalled: Return true if installed, false if not
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
queryAppState
Get the given app status on the device
Appium command. More details can be found in the official protocol docs.
Usage
await driver.queryAppState(appId, bundleId)
Parameters
| Name | Type | Details |
|---|---|---|
appIdoptional | string | App package ID (required for Android) |
bundleIdoptional | string | Bundle ID (required for iOS) |
Returns
- <number>
appStatus: 0 is not installed. 1 is not running. 2 is running in background suspended. 3 is running in background. 4 is running in foreground
Support
- iOS: XCUITest (9.3+)
- Android: UiAutomator (4.2+)
hideKeyboard
Hide soft keyboard.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.hideKeyboard(strategy, key, keyCode, keyName)
Parameters
| Name | Type | Details |
|---|---|---|
strategyoptional | string | hide keyboard strategy (UIAutomation only), available strategies - 'press', 'pressKey', 'swipeDown', 'tapOut', 'tapOutside', 'default' |
keyoptional | string | key value if strategy is 'pressKey' |
keyCodeoptional | string | key code if strategy is 'pressKey' |
keyNameoptional | string | key name if strategy is 'pressKey' |
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
- Windows: Windows (10+)
isKeyboardShown
Whether or not the soft keyboard is shown.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.isKeyboardShown()
Returns
- <boolean>
isKeyboardShown: True if the keyboard is shown
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
- Windows: Windows (10+)
pushFile
Place a file onto the device in a particular place.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.pushFile(path, data)
Parameters
| Name | Type | Details |
|---|---|---|
path | string | path to install the data to |
data | string | contents of file in base64 |
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
- Windows: Windows (10+)
pullFile
Retrieve a file from the device's file system.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.pullFile(path)
Parameters
| Name | Type | Details |
|---|---|---|
path | string | path on the device to pull file from |
Returns
- <string>
response: Contents of file in base64
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
- Windows: Windows (10+)
pullFolder
Retrieve a folder from the device's file system.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.pullFolder(path)
Parameters
| Name | Type | Details |
|---|---|---|
path | string | path to an entire folder on the device |
Returns
- <string>
response: Zip file of the folder contents in base64
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
- Windows: Windows (10+)
appiumToggleAirplaneMode
Toggle airplane mode on device. This is the raw Appium protocol endpoint. Prefer the toggleAirplaneMode mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the toggleAirplaneMode mobile command (driver.toggleAirplaneMode()) instead
Usage
await driver.appiumToggleAirplaneMode()
Support
- Android: UiAutomator (4.2+)
appiumToggleData
Switch the state of data service. This is the raw Appium protocol endpoint. Prefer the toggleData mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the toggleData mobile command (driver.toggleData()) instead
Usage
await driver.appiumToggleData()
Support
- Android: UiAutomator (4.2+)
appiumToggleWiFi
Switch the state of the wifi service. This is the raw Appium protocol endpoint. Prefer the toggleWiFi mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the toggleWiFi mobile command (driver.toggleWiFi()) instead
Usage
await driver.appiumToggleWiFi()
Support
- Android: UiAutomator (4.2+)
appiumToggleLocationServices
Switch the state of the location service. This is the raw Appium protocol endpoint. Prefer the toggleLocationServices mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the toggleLocationServices mobile command (driver.toggleLocationServices()) instead
Usage
await driver.appiumToggleLocationServices()
Support
- Android: UiAutomator (4.2+)
appiumToggleNetworkSpeed
Set network speed (Emulator only). This is the raw Appium protocol endpoint. Prefer the toggleNetworkSpeed mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the toggleNetworkSpeed mobile command (driver.toggleNetworkSpeed()) instead
Usage
await driver.appiumToggleNetworkSpeed(netspeed)
Parameters
| Name | Type | Details |
|---|---|---|
netspeed | string | Network type - 'full','gsm', 'edge', 'hscsd', 'gprs', 'umts', 'hsdpa', 'lte', 'evdo' |
Support
- Android: UiAutomator (4.2+)
appiumOpenNotifications
Open Android notifications. This is the raw Appium protocol endpoint. Prefer the openNotifications mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the openNotifications mobile command (driver.openNotifications()) instead
Usage
await driver.appiumOpenNotifications()
Support
- Android: UiAutomator (4.2+)
appiumStartActivity
Start an Android activity by providing package name and activity name. This is the raw Appium protocol endpoint. Prefer the startActivity mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the startActivity mobile command (driver.startActivity()) instead
Usage
await driver.appiumStartActivity(appPackage, appActivity, appWaitPackage, appWaitActivity, intentAction, intentCategory, intentFlags, optionalIntentArguments, dontStopAppOnReset)
Parameters
| Name | Type | Details |
|---|---|---|
appPackage | string | name of app |
appActivity | string | name of activity |
appWaitPackageoptional | string | name of app to wait for |
appWaitActivityoptional | string | name of activity to wait for |
intentAction=android.intent.action.MAINoptional | string | intent action which will be used to start activity |
intentCategory=android.intent.category.LAUNCHERoptional | string | intent category which will be used to start activity |
intentFlags=0x10200000optional | string | flags that will be used to start activity |
optionalIntentArgumentsoptional | string | additional intent arguments that will be used to start activity |
dontStopAppOnResetoptional | string | doesn’t stop the process of the app under test, before starting the app using adb |
Support
- Android: UiAutomator (4.2+)
appiumGetSystemBars
Retrieve visibility and bounds information of the status and navigation bars. This is the raw Appium protocol endpoint. Prefer the getSystemBars mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the getSystemBars mobile command (driver.getSystemBars()) instead
Usage
await driver.appiumGetSystemBars()
Returns
- <object[]>
systemBars: Information about visibility and bounds of status and navigation bar
Support
- Android: UiAutomator (4.2+)
getDeviceTime
Get the time on the device.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.getDeviceTime()
Returns
- <string>
time: Time on the device
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
appiumGetDisplayDensity
Get display density from device. This is the raw Appium protocol endpoint. Prefer the getDisplayDensity mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the getDisplayDensity mobile command (driver.getDisplayDensity()) instead
Usage
await driver.appiumGetDisplayDensity()
Returns
- <*>
Support
- Android: UiAutomator (4.2+)
appiumTouchId
Simulate a touch id event (iOS Simulator only). To enable this feature, the allowTouchIdEnroll desired capability must be set to true and the Simulator must be enrolled. When you set allowTouchIdEnroll to true, it will set the Simulator to be enrolled by default. The enrollment state can be toggled. This call will only work if Appium process or its parent application (e.g. Terminal.app or Appium.app) has access to Mac OS accessibility in System Preferences > Security & Privacy > Privacy > Accessibility list.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the touchId mobile command (driver.touchId()) instead
Usage
await driver.appiumTouchId(match)
Parameters
| Name | Type | Details |
|---|---|---|
match | boolean | are we simulating a successful touch (true) or a failed touch (false) |
Support
- iOS: XCUITest (9.3+)
appiumToggleEnrollTouchId
Toggle the simulator being enrolled to accept touchId (iOS Simulator only). To enable this feature, the allowTouchIdEnroll desired capability must be set to true. When allowTouchIdEnroll is set to true the Simulator will be enrolled by default, and the 'Toggle Touch ID Enrollment' changes the enrollment state. This call will only work if the Appium process or its parent application (e.g., Terminal.app or Appium.app) has access to Mac OS accessibility in System Preferences > Security & Privacy > Privacy > Accessibility list.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the toggleEnrollTouchId mobile command (driver.toggleEnrollTouchId()) instead
Usage
await driver.appiumToggleEnrollTouchId(enabled)
Parameters
| Name | Type | Details |
|---|---|---|
enabled=trueoptional | boolean | equals to true if TouchID enrollment should be enabled |
Support
- iOS: XCUITest (9.3+)
appiumLaunchApp
Launch an app on device. This is the raw Appium protocol endpoint. Prefer the launchApp mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the launchApp mobile command (driver.launchApp()) instead
Usage
await driver.appiumLaunchApp()
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
appiumCloseApp
Close an app on device. This is the raw Appium protocol endpoint. Prefer the closeApp mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the closeApp mobile command (driver.closeApp()) instead
Usage
await driver.appiumCloseApp()
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
appiumBackground
Send the currently running app for this session to the background. This is the raw Appium protocol endpoint. Prefer the background mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the background mobile command (driver.background()) instead
Usage
await driver.appiumBackground(seconds)
Parameters
| Name | Type | Details |
|---|---|---|
seconds=null | number, null | Timeout after which to restore the app. A value of -1 disables the timeout |
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
endCoverage
Get test coverage data.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: shell', { ... }) instead
Usage
await driver.endCoverage(intent, path)
Parameters
| Name | Type | Details |
|---|---|---|
intent | string | intent to broadcast |
path | string | path to .ec file |
Support
- Android: UiAutomator (4.2+)
appiumGetStrings
Get app strings. This is the raw Appium protocol endpoint. Prefer the getStrings mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the getStrings mobile command (driver.getStrings()) instead
Usage
await driver.appiumGetStrings(language, stringFile)
Parameters
| Name | Type | Details |
|---|---|---|
languageoptional | string | language code |
stringFileoptional | string | path to the string file |
Returns
- <object>
appStrings: all defined Strings from an app for the specified language and strings filename
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
setValueImmediate
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.addValue(...) or driver.setValue(...) instead
Usage
await driver.setValueImmediate(elementId, text)
Parameters
| Name | Type | Details |
|---|---|---|
elementId | String | the id of an element returned in a previous call to Find Element(s) |
text | string | text to set to an element |
Support
- iOS: XCUITest (9.3+)
- Android: UiAutomator (4.2+)
replaceValue
Replace the value to element directly.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.addValue(...) or driver.setValue(...) instead
Usage
await driver.replaceValue(elementId, value)
Parameters
| Name | Type | Details |
|---|---|---|
elementId | String | the id of an element returned in a previous call to Find Element(s) |
value | string | value to replace on element |
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
getSettings
Retrieve the current session settings.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.getSettings()
Returns
- <object>
settings: JSON hash of all the currently specified settings, see Settings API
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
- Windows: Windows (10+)
updateSettings
Update the session settings.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.updateSettings(settings)
Parameters
| Name | Type | Details |
|---|---|---|
settings | object | key/value object with settings to update |
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Android: UiAutomator (4.2+)
- Windows: Windows (10+)
receiveAsyncResponse
Callback url for asynchronous execution of JavaScript.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.executeAsyncScript(...) instead
Usage
await driver.receiveAsyncResponse(response)
Parameters
| Name | Type | Details |
|---|---|---|
response | object | response to receive on device |
Support
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
appiumGsmCall
Make GSM call (Emulator only). This is the raw Appium protocol endpoint. Prefer the gsmCall mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the gsmCall mobile command (driver.gsmCall()) instead
Usage
await driver.appiumGsmCall(phoneNumber, action)
Parameters
| Name | Type | Details |
|---|---|---|
phoneNumber | string | the phone number to call to |
action | string | The action - 'call', 'accept', 'cancel', 'hold' |
Support
- Android: UiAutomator (4.2+)
appiumGsmSignal
Set GSM signal strength (Emulator only). This is the raw Appium protocol endpoint. Prefer the gsmSignal mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the gsmSignal mobile command (driver.gsmSignal()) instead
Usage
await driver.appiumGsmSignal(signalStrength, signalStrengh)
Parameters
| Name | Type | Details |
|---|---|---|
signalStrength | string | signal strength in the range [0, 4] |
signalStrenghoptional | string | signal strength in the range [0, 4]. Please also set this parameter with the same value if you use Appium v1.11.0 or lower (see https://github.com/appium/appium/issues/12234). |
Support
- Android: UiAutomator (4.2+)
appiumPowerCapacity
Set the battery percentage (Emulator only). This is the raw Appium protocol endpoint. Prefer the powerCapacity mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the powerCapacity mobile command (driver.powerCapacity()) instead
Usage
await driver.appiumPowerCapacity(percent)
Parameters
| Name | Type | Details |
|---|---|---|
percent | number | percentage value in range [0, 100] |
Support
- Android: UiAutomator (4.2+)
appiumPowerAC
Set the state of the battery charger to connected or not (Emulator only). This is the raw Appium protocol endpoint. Prefer the powerAC mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the powerAC mobile command (driver.powerAC()) instead
Usage
await driver.appiumPowerAC(state)
Parameters
| Name | Type | Details |
|---|---|---|
state | string | set the state. on or off |
Support
- Android: UiAutomator (4.2+)
appiumGsmVoice
Set GSM voice state (Emulator only). This is the raw Appium protocol endpoint. Prefer the gsmVoice mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the gsmVoice mobile command (driver.gsmVoice()) instead
Usage
await driver.appiumGsmVoice(state)
Parameters
| Name | Type | Details |
|---|---|---|
state | string | state of GSM voice - 'unregistered', 'home', 'roaming', 'searching', 'denied', 'off', 'on' |
Support
- Android: UiAutomator (4.2+)
appiumSendSms
Simulate an SMS message (Emulator only). This is the raw Appium protocol endpoint. Prefer the sendSms mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the sendSms mobile command (driver.sendSms()) instead
Usage
await driver.appiumSendSms(phoneNumber, message)
Parameters
| Name | Type | Details |
|---|---|---|
phoneNumber | string | the phone number to send the SMS too |
message | string | the SMS message |
Support
- Android: UiAutomator (4.2+)
appiumFingerPrint
Authenticate users by using their finger print scans on supported emulators. This is the raw Appium protocol endpoint. Prefer the fingerPrint mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the fingerPrint mobile command (driver.fingerPrint()) instead
Usage
await driver.appiumFingerPrint(fingerprintId)
Parameters
| Name | Type | Details |
|---|---|---|
fingerprintId | number | finger prints stored in Android Keystore system (from 1 to 10) |
Support
- Android: UiAutomator (4.2+)
appiumSetClipboard
Set the content of the system clipboard. This is the raw Appium protocol endpoint. Prefer the setClipboard mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the setClipboard mobile command (driver.setClipboard()) instead
Usage
await driver.appiumSetClipboard(content, contentType, label)
Parameters
| Name | Type | Details |
|---|---|---|
content | string | The actual base64 encoded clipboard content |
contentTypeoptional | string | The type of the content to get. Plaintext, Image, URL. Android supports only plaintext |
labeloptional | string | Clipboard data label for Android |
Returns
- <string>
response: Response from Appium server
Support
- iOS: XCUITest (9.3+)
- Android: UiAutomator (4.2+)
appiumGetClipboard
Get the content of the system clipboard. This is the raw Appium protocol endpoint. Prefer the getClipboard mobile command which provides automatic Appium 3 compatibility with fallback for older drivers.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use the getClipboard mobile command (driver.getClipboard()) instead
Usage
await driver.appiumGetClipboard(contentType)
Parameters
| Name | Type | Details |
|---|---|---|
contentTypeoptional | string | The type of the content to get. Plaintext, Image, URL. Android supports only plaintext |
Returns
- <string>
response: Clipboard content as base64-encoded string or an empty string if the clipboard is empty
Support
- iOS: XCUITest (9.3+)
- Android: UiAutomator (4.2+)
touchPerform
This functionality is only available from within a native context. 'Touch Perform' works similarly to the other singular touch interactions, except that this allows you to chain together more than one touch action as one command. This is useful because Appium commands are sent over the network and there's latency between commands. This latency can make certain touch interactions impossible because some interactions need to be performed in one sequence. Vertical, for example, requires pressing down, moving to a different y coordinate, and then releasing. For it to work, there can't be a delay between the interactions.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.performActions(...) instead
Usage
await driver.touchPerform(actions)
Parameters
| Name | Type | Details |
|---|---|---|
actions | object[] | The type of action to perform (e.g. moveTo, release, press, tap, wait) |
Example
// do a horizontal swipe by percentage
const startPercentage = 10;
const endPercentage = 90;
const anchorPercentage = 50;
const { width, height } = driver.getWindowSize();
const anchor = height * anchorPercentage / 100;
const startPoint = width * startPercentage / 100;
const endPoint = width * endPercentage / 100;
driver.touchPerform([
{
action: 'press',
options: {
x: startPoint,
y: anchor,
},
},
{
action: 'wait',
options: {
ms: 100,
},
},
{
action: 'moveTo',
options: {
x: endPoint,
y: anchor,
},
},
{
action: 'release',
options: {},
},
]);
Support
- Android: UiAutomator (4.2+)
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Windows: Windows (10+)
multiTouchPerform
This functionality is only available from within a native context. Perform a multi touch action sequence.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.performActions(...) instead
Usage
await driver.multiTouchPerform(actions)
Parameters
| Name | Type | Details |
|---|---|---|
actions | object[] | The type of action to perform (e.g. moveTo, release, press, tap, wait) |
Support
- Android: UiAutomator (4.2+)
- iOS: XCUITest (9.3+), UIAutomation (8.0 to 9.3)
- Windows: Windows (10+)
executeDriverScript
Execute a script in a child process. This approach helps minimize potential latency associated with each command. Using this command in Appium 2 or later requires installing the execute-driver plugin.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.executeDriverScript(script, type, timeout)
Parameters
| Name | Type | Details |
|---|---|---|
script | string | The script to execute. It has access to a 'driver' object which represents a WebdriverIO session attached to the current server. |
typeoptional | string | The language/framework used in the script. Currently, only 'webdriverio' is supported and is the default. |
timeoutoptional | number | The number of milliseconds the script should be allowed to run before being killed by the Appium server. Defaults to the equivalent of 1 hour. |
Returns
- <object>
result: An object containing two fields: 'result', which is the return value of the script itself, and 'logs', which contains 3 inner fields, 'log', 'warn', and 'error', which hold an array of strings logged by console.log, console.warn, and console.error in the script's execution.
getEvents
Get events logged in the current session.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.getEvents(type)
Parameters
| Name | Type | Details |
|---|---|---|
typeoptional | string, string[] | One or more event types to filter the returned events |
Returns
- <object>
result: A JSON hash of events like{'commands' => [{'cmd' => 123455, ....}], 'startTime' => 1572954894127, }.
Support
- Android: UiAutomator (4.2+)
- iOS: XCUITest (9.3+)
logEvent
Log a custom event.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.logEvent(vendor, event)
Parameters
| Name | Type | Details |
|---|---|---|
vendor | string | Name of the namespace (vendor) used to prefix the event |
event | string | Name of the event |
Support
- Android: UiAutomator (4.2+)
- iOS: XCUITest (9.3+)
compareImages
Compare two images using the specified mode of comparison. Using this command in Appium 2 or later requires installing the images plugin.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.compareImages(mode, firstImage, secondImage, options)
Parameters
| Name | Type | Details |
|---|---|---|
mode | string | One of possible comparison modes: 'matchFeatures', 'getSimilarity', 'matchTemplate'. |
firstImage | string | Base64-encoded image file. |
secondImage | string | Base64-encoded image file. |
options=[object Object]optional | object | The supported values of this property depend on the mode value. See Appium documentation for more details. |
Returns
- <object>
result: The content of the resulting dictionary depends on themodeandoptionsvalues. See Appium documentation for more details.
implicitWait
Set the amount of time the driver should wait when searching for elements. When searching for a single element, the driver should poll the page until an element is found or the timeout expires, whichever occurs first. When searching for multiple elements, the driver should poll the page until at least one element is found or the timeout expires, at which point it should return an empty list. If this command is never sent, the driver should default to an implicit wait of 0ms.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.setTimeouts(...) instead
Usage
await driver.implicitWait(ms)
Parameters
| Name | Type | Details |
|---|---|---|
ms | number | The amount of time, in milliseconds, to wait on an element. |
Support
- Android: UiAutomator (4.2+)
- iOS: XCUITest (9.3+)
getLocationInView
Determine an element's location on the screen once it has been scrolled into view.
Note: This is considered an internal command and should only be used to determine an element's location for correctly generating native events.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.getElementRect(...) or element.getLocation() instead
Usage
await driver.getLocationInView(elementId)
Parameters
| Name | Type | Details |
|---|---|---|
elementId | String | ID of the element to route the command to |
Returns
- <Object>
location: The X and Y coordinates for the element on the page.
Support
- Android: UiAutomator (4.2+)
- iOS: XCUITest (9.3+)
sendKeys
Send a sequence of key strokes to the active element
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.performActions(...) with keyUp and keyDown actions instead
Usage
await driver.sendKeys(value)
Parameters
| Name | Type | Details |
|---|---|---|
value | string[] | The sequence of keys to type. An array must be provided. |
Support
- Android: UiAutomator (4.2+)
- iOS: XCUITest (9.3+)
availableIMEEngines
List all available IME engines on the device. To use an engine, it has to be present in this list.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.availableIMEEngines()
Returns
- <String[]>
engines: A list of available engines
Support
- Android: UiAutomator (4.2+)
getActiveIMEEngine
Get the name of the active IME engine. The name string is platform specific.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.getActiveIMEEngine()
Returns
- <String>
engine: The name of the active IME engine
Support
- Android: UiAutomator (4.2+)
isIMEActivated
Indicates whether IME input is active at the moment
Appium command. More details can be found in the official protocol docs.
Usage
await driver.isIMEActivated()
Returns
- <Boolean>
isActive: true if IME input is available and currently active, false otherwise
Support
- Android: UiAutomator (4.2+)
deactivateIMEEngine
De-activates the currently-active IME engine.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.deactivateIMEEngine()
Support
- Android: UiAutomator (4.2+)
activateIMEEngine
Activates an IME engine.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.activateIMEEngine(engine)
Parameters
| Name | Type | Details |
|---|---|---|
engine | string | name of the engine to activate |
Support
- Android: UiAutomator (4.2+)
asyncScriptTimeout
Set the amount of time, in milliseconds, that asynchronous scripts executed by /session/:sessionId/execute_async are permitted to run before they are aborted and a Timeout error is returned to the client.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.setTimeouts(...) instead
Usage
await driver.asyncScriptTimeout(ms)
Parameters
| Name | Type | Details |
|---|---|---|
ms | number | The amount of time, in milliseconds, that time-limited commands are permitted to run |
Support
- iOS: XCUITest (9.3+)
submit
Submit a form element.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Please explicitly find and click the submit element
Usage
await driver.submit(elementId)
Parameters
| Name | Type | Details |
|---|---|---|
elementId | String | ID of the form element to be submitted |
Support
- iOS: XCUITest (9.3+)
getElementSize
Determine an element's size in pixels. The size will be returned as a JSON object with width and height properties.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.getElementRect(...) or element.getSize() instead
Usage
await driver.getElementSize(elementId)
Parameters
| Name | Type | Details |
|---|---|---|
elementId | String | ID of the element to route the command to |
Returns
- <Object>
size: The width and height of the element, in pixels.
Support
- Android: UiAutomator (4.2+)
- iOS: XCUITest (9.3+)
getElementLocation
Determine an element's location on the page. The point (0, 0) refers to the upper-left corner of the page. The element's coordinates are returned as a JSON object with x and y properties.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.getElementRect(...) or element.getLocation() instead
Usage
await driver.getElementLocation(elementId)
Parameters
| Name | Type | Details |
|---|---|---|
elementId | String | ID of the element to route the command to |
Returns
- <Object>
location: The X and Y coordinates for the element on the page.
Support
- Android: UiAutomator (4.2+)
- iOS: XCUITest (9.3+)
touchClick
Single tap on the touch enabled device.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.performActions(...) with pointerDown and pointerUp actions instead
Usage
await driver.touchClick(element)
Parameters
| Name | Type | Details |
|---|---|---|
element | string | ID of the element to single tap on. |
Support
- Android: UiAutomator (4.2+)
- iOS: XCUITest (9.3+)
touchDown
Finger down on the screen.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.performActions(...) with a pointerDown action instead
Usage
await driver.touchDown(x, y)
Parameters
| Name | Type | Details |
|---|---|---|
x | number | x coordinate on the screen |
y | number | y coordinate on the screen |
Support
- Android: UiAutomator (4.2+)
touchUp
Finger up on the screen.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.performActions(...) with a pointerUp action instead
Usage
await driver.touchUp(x, y)
Parameters
| Name | Type | Details |
|---|---|---|
x | number | x coordinate on the screen |
y | number | y coordinate on the screen |
Support
- Android: UiAutomator (4.2+)
touchMove
Finger move on the screen.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.performActions(...) with a pointerMove action instead
Usage
await driver.touchMove(x, y)
Parameters
| Name | Type | Details |
|---|---|---|
x | number | x coordinate on the screen |
y | number | y coordinate on the screen |
Support
- Android: UiAutomator (4.2+)
touchLongClick
Long press on the touch screen using finger motion events.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.performActions(...) with pointerDown, pause and pointerUp actions instead
Usage
await driver.touchLongClick(element)
Parameters
| Name | Type | Details |
|---|---|---|
element | string | ID of the element to long press on |
Support
- Android: UiAutomator (4.2+)
touchFlick
Flick on the touch screen using finger motion events. This flick command starts at a particular screen location.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.performActions(...) with pointerDown, pointerMove and pointerUp actions instead
Usage
await driver.touchFlick(xoffset, yoffset, element, speed, xspeed, yspeed)
Parameters
| Name | Type | Details |
|---|---|---|
xoffsetoptional | number | the x offset in pixels to flick by |
yoffsetoptional | number | the y offset in pixels to flick by |
elementoptional | string | ID of the element where the flick starts |
speedoptional | number | the speed in pixels per seconds |
xspeedoptional | number | the x speed in pixels per second |
yspeedoptional | number | the y speed in pixels per second |
Support
- Android: UiAutomator (4.2+)
getOrientation
Get the current device orientation.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.getOrientation()
Returns
- <String>
orientation: The current orientation corresponding to a value defined in ScreenOrientation:LANDSCAPE|PORTRAIT.
Support
- Android: UiAutomator (4.2+)
- iOS: XCUITest (9.3+)
setOrientation
Set the device orientation
Appium command. More details can be found in the official protocol docs.
Usage
await driver.setOrientation(orientation)
Parameters
| Name | Type | Details |
|---|---|---|
orientation | string | the new browser orientation as defined in ScreenOrientation: LANDSCAPE|PORTRAIT |
Support
- Android: UiAutomator (4.2+)
- iOS: XCUITest (9.3+)
getGeoLocation
Get the current geo location.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.getGeoLocation()
Returns
- <Object>
location: The current geo location.
setGeoLocation
Set the current geo location.
Appium command. More details can be found in the official protocol docs.
Usage
await driver.setGeoLocation(location)
Parameters
| Name | Type | Details |
|---|---|---|
location | object | the new location ({latitude: number, longitude: number, altitude: number}) |