Appium
getLogTypesโ
Get available log types.
Appium command. More details can be found in the official protocol docs.
Usageโ
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โ
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โ
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โ
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โ
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โ
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โ
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โ
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โ
driver.getAppiumSessionCapabilities()
Returnsโ
- <Object>
capabilities: An object describing the session's capabilities.
shakeโ
Perform a shake action on the device.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: shake') instead
Usageโ
driver.shake()
Supportโ
lockโ
Lock the device.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: lock', { ... }) instead
Usageโ
driver.lock(seconds)
Parametersโ
| Name | Type | Details |
|---|---|---|
secondsoptional | number | how long to lock the screen (iOS only) |
Supportโ
unlockโ
Unlock the device.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: unlock') instead
Usageโ
driver.unlock()
Supportโ
isLockedโ
Check whether the device is locked or not.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: isLocked') instead
Usageโ
driver.isLocked()
Returnsโ
- <boolean>
isLocked: True if the device is locked, false if not
Supportโ
startRecordingScreenโ
Start recording the screen.
Appium command. More details can be found in the official protocol docs.
Usageโ
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โ
stopRecordingScreenโ
Stop recording screen
Appium command. More details can be found in the official protocol docs.
Usageโ
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โ
getPerformanceDataTypesโ
Returns the information types of the system state which is supported to read as like cpu, memory, network traffic, and battery.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: getPerformanceDataTypes') instead
Usageโ
driver.getPerformanceDataTypes()
Returnsโ
- <string[]>
performanceTypes: The available performance data types (cpuinfo|batteryinfo|networkinfo|memoryinfo)
Supportโ
getPerformanceDataโ
Returns the information of the system state which is supported to read as like cpu, memory, network traffic, and battery.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: getPerformanceData', { ... }) instead
Usageโ
driver.getPerformanceData(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โ
pressKeyCodeโ
Press a particular key on the device.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: pressKey', { ... }) instead
Usageโ
driver.pressKeyCode(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โ
longPressKeyCodeโ
Press and hold a particular key code on the device.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: pressKey', { ... }) instead
Usageโ
driver.longPressKeyCode(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โ
sendKeyEventโ
Send a key code to the device.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: pressKey', { ... }) instead
Usageโ
driver.sendKeyEvent(keycode, metastate)
Parametersโ
| Name | Type | Details |
|---|---|---|
keycode | string | keycode to press |
metastateoptional | string | meta state to press the keycode with |
Supportโ
rotateDeviceโ
Rotate the device in three dimensions.
Appium command. More details can be found in the official protocol docs.
Usageโ
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โ
getCurrentActivityโ
Get the name of the current Android activity.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: getCurrentActivity') instead
Usageโ
driver.getCurrentActivity()
Returnsโ
- <string>
activity: Name of the current activity
Supportโ
getCurrentPackageโ
Get the name of the current Android package.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: getCurrentPackage') instead
Usageโ
driver.getCurrentPackage()
Returnsโ
- <string>
package: Name of the current package
Supportโ
installAppโ
Install the given app onto the device.
Appium command. More details can be found in the official protocol docs.
Usageโ
driver.installApp(appPath, options)
Parametersโ
| Name | Type | Details |
|---|---|---|
appPath | string | Path to application .apk file |
optionsoptional | object | Driver-specific installation options |
Supportโ
activateAppโ
Activate the given app on the device
Appium command. More details can be found in the official protocol docs.
Usageโ
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โ
removeAppโ
Remove an app from the device.
Appium command. More details can be found in the official protocol docs.
Usageโ
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โ
terminateAppโ
Terminate the given app on the device
Appium command. More details can be found in the official protocol docs.
Usageโ
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โ
isAppInstalledโ
Check whether the specified app is installed on the device.
Appium command. More details can be found in the official protocol docs.
Usageโ
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โ
queryAppStateโ
Get the given app status on the device
Appium command. More details can be found in the official protocol docs.
Usageโ
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โ
hideKeyboardโ
Hide soft keyboard.
Appium command. More details can be found in the official protocol docs.
Usageโ
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โ
isKeyboardShownโ
Whether or not the soft keyboard is shown.
Appium command. More details can be found in the official protocol docs.
Usageโ
driver.isKeyboardShown()
Returnsโ
- <boolean>
isKeyboardShown: True if the keyboard is shown
Supportโ
pushFileโ
Place a file onto the device in a particular place.
Appium command. More details can be found in the official protocol docs.
Usageโ
driver.pushFile(path, data)
Parametersโ
| Name | Type | Details |
|---|---|---|
path | string | path to install the data to |
data | string | contents of file in base64 |
Supportโ
pullFileโ
Retrieve a file from the device's file system.
Appium command. More details can be found in the official protocol docs.
Usageโ
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โ
pullFolderโ
Retrieve a folder from the device's file system.
Appium command. More details can be found in the official protocol docs.
Usageโ
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โ
toggleAirplaneModeโ
Toggle airplane mode on device.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: setConnectivity', { ... }) instead
Usageโ
driver.toggleAirplaneMode()
Supportโ
toggleDataโ
Switch the state of data service.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: setConnectivity', { ... }) instead
Usageโ
driver.toggleData()
Supportโ
toggleWiFiโ
Switch the state of the wifi service.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: setConnectivity', { ... }) instead
Usageโ
driver.toggleWiFi()
Supportโ
toggleLocationServicesโ
Switch the state of the location service.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: toggleGps') instead
Usageโ
driver.toggleLocationServices()
Supportโ
toggleNetworkSpeedโ
Set network speed (Emulator only)
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: networkSpeed', { ... }) instead
Usageโ
driver.toggleNetworkSpeed(netspeed)
Parametersโ
| Name | Type | Details |
|---|---|---|
netspeed | string | Network type - 'full','gsm', 'edge', 'hscsd', 'gprs', 'umts', 'hsdpa', 'lte', 'evdo' |
Supportโ
openNotificationsโ
Open Android notifications.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: openNotifications') or driver.execute('mobile: statusBar', { ... }) instead
Usageโ
driver.openNotifications()
Supportโ
startActivityโ
Start an Android activity by providing package name and activity name.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: startActivity', { ... }) instead
Usageโ
driver.startActivity(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โ
getSystemBarsโ
Retrieve visibility and bounds information of the status and navigation bars.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: getSystemBars') instead
Usageโ
driver.getSystemBars()
Returnsโ
- <object[]>
systemBars: Information about visibility and bounds of status and navigation bar
Supportโ
getDeviceTimeโ
Get the time on the device.
Appium command. More details can be found in the official protocol docs.
Usageโ
driver.getDeviceTime()
Returnsโ
- <string>
time: Time on the device
Supportโ
getDisplayDensityโ
Get display density from device.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: getDisplayDensity') instead
Usageโ
driver.getDisplayDensity()
Returnsโ
- <*>
Supportโ
touchIdโ
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 driver.execute('mobile: sendBiometricMatch', { ... }) instead
Usageโ
driver.touchId(match)
Parametersโ
| Name | Type | Details |
|---|---|---|
match | boolean | are we simulating a successful touch (true) or a failed touch (false) |
Supportโ
toggleEnrollTouchIdโ
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 driver.execute('mobile: enrollBiometric', { ... }) instead
Usageโ
driver.toggleEnrollTouchId(enabled)
Parametersโ
| Name | Type | Details |
|---|---|---|
enabled=trueoptional | boolean | equals to true if TouchID enrollment should be enabled |
Supportโ
launchAppโ
Launch an app on device.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: launchApp', { ... }) (iOS) or driver.execute('mobile: activateApp', { ... }) (Android) instead
Usageโ
driver.launchApp()
Supportโ
closeAppโ
Close an app on device.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: terminateApp', { ... }) instead
Usageโ
driver.closeApp()
Supportโ
backgroundโ
Send the currently running app for this session to the background.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: backgroundApp', { ... }) instead
Usageโ
driver.background(seconds)
Parametersโ
| Name | Type | Details |
|---|---|---|
seconds=null | number, null | Timeout after which to restore the app. A value of -1 disables the timeout |
Supportโ
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โ
driver.endCoverage(intent, path)
Parametersโ
| Name | Type | Details |
|---|---|---|
intent | string | intent to broadcast |
path | string | path to .ec file |
Supportโ
getStringsโ
Get app strings.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: getAppStrings', { ... }) instead
Usageโ
driver.getStrings(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โ
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โ
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โ
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โ
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โ
getSettingsโ
Retrieve the current session settings.
Appium command. More details can be found in the official protocol docs.
Usageโ
driver.getSettings()
Returnsโ
- <object>
settings: JSON hash of all the currently specified settings, see Settings API
Supportโ
updateSettingsโ
Update the session settings.
Appium command. More details can be found in the official protocol docs.
Usageโ
driver.updateSettings(settings)
Parametersโ
| Name | Type | Details |
|---|---|---|
settings | object | key/value object with settings to update |
Supportโ
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โ
driver.receiveAsyncResponse(response)
Parametersโ
| Name | Type | Details |
|---|---|---|
response | object | response to receive on device |
Supportโ
gsmCallโ
Make GSM call (Emulator only).
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: gsmCall', { ... }) instead
Usageโ
driver.gsmCall(phoneNumber, action)
Parametersโ
| Name | Type | Details |
|---|---|---|
phoneNumber | string | the phone number to call to |
action | string | The action - 'call', 'accept', 'cancel', 'hold' |
Supportโ
gsmSignalโ
Set GSM signal strength (Emulator only).
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: gsmSignal', { ... }) instead
Usageโ
driver.gsmSignal(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โ
powerCapacityโ
Set the battery percentage (Emulator only).
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: powerCapacity', { ... }) instead
Usageโ
driver.powerCapacity(percent)
Parametersโ
| Name | Type | Details |
|---|---|---|
percent | number | percentage value in range [0, 100] |
Supportโ
powerACโ
Set the state of the battery charger to connected or not (Emulator only).
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: powerAC', { ... }) instead
Usageโ
driver.powerAC(state)
Parametersโ
| Name | Type | Details |
|---|---|---|
state | string | set the state. on or off |
Supportโ
gsmVoiceโ
Set GSM voice state (Emulator only).
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: gsmVoice', { ... }) instead
Usageโ
driver.gsmVoice(state)
Parametersโ
| Name | Type | Details |
|---|---|---|
state | string | state of GSM voice - 'unregistered', 'home', 'roaming', 'searching', 'denied', 'off', 'on' |
Supportโ
sendSmsโ
Simulate an SMS message (Emulator only).
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: sendSms', { ... }) instead
Usageโ
driver.sendSms(phoneNumber, message)
Parametersโ
| Name | Type | Details |
|---|---|---|
phoneNumber | string | the phone number to send the SMS too |
message | string | the SMS message |
Supportโ
fingerPrintโ
Authenticate users by using their finger print scans on supported emulators.
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: fingerPrint', { ... }) instead
Usageโ
driver.fingerPrint(fingerprintId)
Parametersโ
| Name | Type | Details |
|---|---|---|
fingerprintId | number | finger prints stored in Android Keystore system (from 1 to 10) |
Supportโ
setClipboardโ
Set the content of the system clipboard
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: setClipboard', { ... }) instead
Usageโ
driver.setClipboard(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โ
getClipboardโ
Get the content of the system clipboard
Appium command. More details can be found in the official protocol docs.
This protocol command is deprecated
Use driver.execute('mobile: getClipboard', { ... }) instead
Usageโ
driver.getClipboard(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โ
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โ
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โ
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โ
driver.multiTouchPerform(actions)
Parametersโ
| Name | Type | Details |
|---|---|---|
actions | object[] | The type of action to perform (e.g. moveTo, release, press, tap, wait) |
Supportโ
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โ
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โ
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โ
logEventโ
Log a custom event.
Appium command. More details can be found in the official protocol docs.
Usageโ
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โ
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โ
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โ
driver.implicitWait(ms)
Parametersโ
| Name | Type | Details |
|---|---|---|
ms | number | The amount of time, in milliseconds, to wait on an element. |
Supportโ
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โ
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โ
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โ
driver.sendKeys(value)
Parametersโ
| Name | Type | Details |
|---|---|---|
value | string[] | The sequence of keys to type. An array must be provided. |
Supportโ
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โ
driver.availableIMEEngines()
Returnsโ
- <String[]>
engines: A list of available engines
Supportโ
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โ
driver.getActiveIMEEngine()
Returnsโ
- <String>
engine: The name of the active IME engine
Supportโ
isIMEActivatedโ
Indicates whether IME input is active at the moment
Appium command. More details can be found in the official protocol docs.
Usageโ
driver.isIMEActivated()
Returnsโ
- <Boolean>
isActive: true if IME input is available and currently active, false otherwise
Supportโ
deactivateIMEEngineโ
De-activates the currently-active IME engine.
Appium command. More details can be found in the official protocol docs.
Usageโ
driver.deactivateIMEEngine()
Supportโ
activateIMEEngineโ
Activates an IME engine.
Appium command. More details can be found in the official protocol docs.
Usageโ
driver.activateIMEEngine(engine)
Parametersโ
| Name | Type | Details |
|---|---|---|
engine | string | name of the engine to activate |
Supportโ
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โ
driver.asyncScriptTimeout(ms)
Parametersโ
| Name | Type | Details |
|---|---|---|
ms | number | The amount of time, in milliseconds, that time-limited commands are permitted to run |
Supportโ
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โ
driver.submit(elementId)
Parametersโ
| Name | Type | Details |
|---|---|---|
elementId | String | ID of the form element to be submitted |
Supportโ
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โ
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โ
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โ
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โ
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โ
driver.touchClick(element)
Parametersโ
| Name | Type | Details |
|---|---|---|
element | string | ID of the element to single tap on. |
Supportโ
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โ
driver.touchDown(x, y)
Parametersโ
| Name | Type | Details |
|---|---|---|
x | number | x coordinate on the screen |
y | number | y coordinate on the screen |
Supportโ
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โ
driver.touchUp(x, y)
Parametersโ
| Name | Type | Details |
|---|---|---|
x | number | x coordinate on the screen |
y | number | y coordinate on the screen |
Supportโ
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โ
driver.touchMove(x, y)
Parametersโ
| Name | Type | Details |
|---|---|---|
x | number | x coordinate on the screen |
y | number | y coordinate on the screen |
Supportโ
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โ
driver.touchLongClick(element)
Parametersโ
| Name | Type | Details |
|---|---|---|
element | string | ID of the element to long press on |
Supportโ
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โ
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โ
getOrientationโ
Get the current device orientation.
Appium command. More details can be found in the official protocol docs.
Usageโ
driver.getOrientation()
Returnsโ
- <String>
orientation: The current orientation corresponding to a value defined in ScreenOrientation:LANDSCAPE|PORTRAIT.
Supportโ
setOrientationโ
Set the device orientation
Appium command. More details can be found in the official protocol docs.
Usageโ
driver.setOrientation(orientation)
Parametersโ
| Name | Type | Details |
|---|---|---|
orientation | string | the new browser orientation as defined in ScreenOrientation: LANDSCAPE|PORTRAIT |
Supportโ
getGeoLocationโ
Get the current geo location.
Appium command. More details can be found in the official protocol docs.
Usageโ
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โ
driver.setGeoLocation(location)
Parametersโ
| Name | Type | Details |
|---|---|---|
location | object | the new location ({latitude: number, longitude: number, altitude: number}) |