Appium

shake#

Perform a shake action on the device.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.shake()
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3)


lock#

Lock the device.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.lock(seconds)
Parameters#
NameTypeDetails
seconds
optional
numberhow long to lock the screen (iOS only)
Support#

Support for UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+) Support for Windows (10+)


unlock#

Unlock the device.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.unlock()
Support#

Support for UiAutomator (4.2+) Support for Windows (10+)


isLocked#

Check whether the device is locked or not.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.isLocked()
Returns#
  • <boolean> isLocked: True if the device is locked, false if not
Support#

Support for UiAutomator (4.2+) Support for Windows (10+)


startRecordingScreen#

Start recording the screen.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.startRecordingScreen(options)
Parameters#
NameTypeDetails
options
optional
objectcommand 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#

Support for XCUITest (9.3+) Support for UiAutomator (4.2+)


stopRecordingScreen#

Stop recording screen

Appium command. More details can be found in the official protocol docs.

Usage#
driver.stopRecordingScreen(remotePath, username, password, method)
Parameters#
NameTypeDetails
remotePath
optional
stringThe 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.
username
optional
stringThe name of the user for the remote authentication.
password
optional
stringThe password for the remote authentication.
method
optional
stringThe 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#

Support for XCUITest (9.3+) Support for UiAutomator (4.2+)


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.

Usage#
driver.getPerformanceDataTypes()
Returns#
  • <string[]> performanceTypes: The available performance data types (cpuinfo|batteryinfo|networkinfo|memoryinfo)
Support#

Support for UiAutomator (4.2+)


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.

Usage#
driver.getPerformanceData(packageName, dataType, dataReadTimeout)
Parameters#
NameTypeDetails
packageNamestringthe package name of the application
dataTypestringthe type of system state which wants to read. It should be one of the supported performance data types
dataReadTimeout
optional
numberthe 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#

Support for UiAutomator (4.2+)


pressKeyCode#

Press a particular key on the device.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.pressKeyCode(keycode, metastate, flags)
Parameters#
NameTypeDetails
keycodenumberkeycode to press
metastate
optional
numbermeta state to press the keycode with
flags
optional
numberflags for the keypress
Support#

Support for UiAutomator (4.2+)


longPressKeyCode#

Press and hold a particular key code on the device.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.longPressKeyCode(keycode, metastate, flags)
Parameters#
NameTypeDetails
keycodenumberkeycode to press on the device
metastate
optional
numbermetastate for the keypress
flags
optional
numberflags for the keypress
Support#

Support for UiAutomator (4.2+)


sendKeyEvent#

Send a key code to the device.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.sendKeyEvent(keycode, metastate)
Parameters#
NameTypeDetails
keycodestringkeycode to press
metastate
optional
stringmeta state to press the keycode with

rotateDevice#

Rotate the device in three dimensions.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.rotateDevice(x, y, radius, rotation, touchCount, duration, element)
Parameters#
NameTypeDetails
xnumberx offset to use for the center of the rotate gesture
ynumbery offset to use for the center of the rotate gesture
radiusnumberthe distance in points from the center to the edge of the circular path
rotationnumberthe length of rotation in radians
touchCountnumberthe number of touches to use in the specified gesture
durationnumberthe length of hold time for the specified gesture, in seconds
element
optional
stringthe id of an element returned in a previous call to execute the rotation on
Support#

Support for UIAutomation (8.0 to 9.3)


getCurrentActivity#

Get the name of the current Android activity.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.getCurrentActivity()
Returns#
  • <string> activity: Name of the current activity
Support#

Support for UiAutomator (4.2+)


getCurrentPackage#

Get the name of the current Android package.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.getCurrentPackage()
Returns#
  • <string> package: Name of the current package
Support#

Support for UiAutomator (4.2+)


installApp#

Install the given app onto the device.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.installApp(appPath)
Parameters#
NameTypeDetails
appPathstringpath to application .apk file
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


activateApp#

Activate the given app onto the device

Appium command. More details can be found in the official protocol docs.

Usage#
driver.activateApp(appId, bundleId)
Parameters#
NameTypeDetails
appId
optional
stringREQUIRED for Android
bundleId
optional
stringREQUIRED for iOS
Support#

Support for XCUITest (9.3+) Support for UiAutomator (4.2+)


removeApp#

Remove an app from the device.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.removeApp(appId, bundleId)
Parameters#
NameTypeDetails
appId
optional
stringREQUIRED for Android
bundleId
optional
stringREQUIRED for iOS
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


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)
Parameters#
NameTypeDetails
appId
optional
stringREQUIRED for Android
bundleId
optional
stringREQUIRED for iOS
Support#

Support for XCUITest (9.3+) Support for 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#
driver.isAppInstalled(appId, bundleId)
Parameters#
NameTypeDetails
appId
optional
stringREQUIRED for Android
bundleId
optional
stringREQUIRED for iOS
Returns#
  • <boolean> isAppInstalled: Return true if installed, false if not
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for 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#
driver.queryAppState(appId, bundleId)
Parameters#
NameTypeDetails
appId
optional
stringREQUIRED for Android
bundleId
optional
stringREQUIRED for iOS
Returns#
  • <number> appStatus: 0 is not installed. 1 is not running. 2 is running in background or suspended. 3 is running in background. 4 is running in foreground
Support#

Support for XCUITest (9.3+) Support for UiAutomator (4.2+)


hideKeyboard#

Hide soft keyboard.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.hideKeyboard(strategy, key, keyCode, keyName)
Parameters#
NameTypeDetails
strategy
optional
stringhide keyboard strategy (UIAutomation only), available strategies - 'press', 'pressKey', 'swipeDown', 'tapOut', 'tapOutside', 'default'
key
optional
stringkey value if strategy is 'pressKey'
keyCode
optional
stringkey code if strategy is 'pressKey'
keyName
optional
stringkey name if strategy is 'pressKey'
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+) Support for Windows (10+)


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#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+) Support for 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#
driver.pushFile(path, data)
Parameters#
NameTypeDetails
pathstringpath to install the data to
datastringcontents of file in base64
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


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#
NameTypeDetails
pathstringpath on the device to pull file from
Returns#
  • <string> response: Contents of file in base64
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


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#
NameTypeDetails
pathstringpath to an entire folder on the device
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


toggleAirplaneMode#

Toggle airplane mode on device.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.toggleAirplaneMode()
Support#

Support for UiAutomator (4.2+)


toggleData#

Switch the state of data service.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.toggleData()
Support#

Support for UiAutomator (4.2+)


toggleWiFi#

Switch the state of the wifi service.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.toggleWiFi()
Support#

Support for UiAutomator (4.2+)


toggleLocationServices#

Switch the state of the location service.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.toggleLocationServices()
Support#

Support for UiAutomator (4.2+)


toggleNetworkSpeed#

Set network speed (Emulator only)

Appium command. More details can be found in the official protocol docs.

Usage#
driver.toggleNetworkSpeed()
Support#

Support for UiAutomator (4.2+)


openNotifications#

Open Android notifications (Emulator only).

Appium command. More details can be found in the official protocol docs.

Usage#
driver.openNotifications()
Support#

Support for UiAutomator (4.2+)


startActivity#

Start an Android activity by providing package name and activity name.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.startActivity(appPackage, appActivity, appWaitPackage, appWaitActivity, intentAction, intentCategory, intentFlags, optionalIntentArguments, dontStopAppOnReset)
Parameters#
NameTypeDetails
appPackagestringname of app
appActivitystringname of activity
appWaitPackage
optional
stringname of app to wait for
appWaitActivity
optional
stringname of activity to wait for
intentAction
optional
stringintent action which will be used to start activity
intentCategory
optional
stringintent category which will be used to start activity
intentFlags
optional
stringflags that will be used to start activity
optionalIntentArguments
optional
stringadditional intent arguments that will be used to start activity
dontStopAppOnReset
optional
stringdoesn’t stop the process of the app under test, before starting the app using adb
Support#

Support for UiAutomator (4.2+)


getSystemBars#

Retrieve visibility and bounds information of the status and navigation bars.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.getSystemBars()
Returns#
  • <object[]> systemBars: Information about visibility and bounds of status and navigation bar
Support#

Support for UiAutomator (4.2+)


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#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


getDisplayDensity#

Get display density from device.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.getDisplayDensity()
Returns#
  • <*> displayDensity:
Support#

Support for UiAutomator (4.2+)


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.

Usage#
driver.touchId(match)
Parameters#
NameTypeDetails
matchbooleanare we simulating a successful touch (true) or a failed touch (false)
Support#

Support for XCUITest (9.3+)


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.

Usage#
driver.toggleEnrollTouchId(enabled)
Parameters#
NameTypeDetails
enabled
optional
booleanequals to true if TouchID enrollment should be enabled
Support#

Support for XCUITest (9.3+)


launchApp#

Launch an app on device. iOS tests with XCUITest can also use the mobile: launchApp method. See detailed documentation.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.launchApp()
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


closeApp#

Close an app on device.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.closeApp()
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


reset#

Reset the currently running app for this session.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.reset()
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


background#

Send the currently running app for this session to the background. iOS tests with XCUITest can also use the mobile: terminateApp method to terminate the current app (see detailed documentation), and the mobile: activateApp to activate an existing application on the device under test and moves it to the foreground (see detailed documentation).

Appium command. More details can be found in the official protocol docs.

Usage#
driver.background(seconds)
Parameters#
NameTypeDetails
secondsnumber, nulltimeout to restore app, if 'null' app won't be restored
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


endCoverage#

Get test coverage data.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.endCoverage(intent, path)
Parameters#
NameTypeDetails
intentstringintent to broadcast
pathstringpath to .ec file
Support#

Support for UiAutomator (4.2+)


getStrings#

Get app strings.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.getStrings(language, stringFile)
Parameters#
NameTypeDetails
language
optional
stringlanguage code
stringFile
optional
stringpath to the string file
Returns#
  • <object> appStrings: all defined Strings from an app for the specified language and strings filename
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


setValueImmediate#

Appium command. More details can be found in the official protocol docs.

Usage#
driver.setValueImmediate(elementId, value)
Parameters#
NameTypeDetails
elementIdStringthe id of an element returned in a previous call to Find Element(s)
valuestringvalue to set on element
Support#

Support for XCUITest (9.3+)


replaceValue#

Replace the value to element directly.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.replaceValue(elementId, value)
Parameters#
NameTypeDetails
elementIdStringthe id of an element returned in a previous call to Find Element(s)
valuestringvalue to replace on element
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+)


getSettings#

Retrieve the current settings on the device.

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#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+) Support for Windows (10+)


updateSettings#

Update the current setting on the device.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.updateSettings(settings)
Parameters#
NameTypeDetails
settingsobjectkey/value object with settings to update
Support#

Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for UiAutomator (4.2+) Support for Windows (10+)


receiveAsyncResponse#

Callback url for asynchronous execution of JavaScript.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.receiveAsyncResponse(response)
Parameters#
NameTypeDetails
responseobjectresponse to receive on device

gsmCall#

Make GSM call (Emulator only).

Appium command. More details can be found in the official protocol docs.

Usage#
driver.gsmCall(phoneNumber, action)
Parameters#
NameTypeDetails
phoneNumberstringthe phone number to call to
actionstringThe action - 'call', 'accept', 'cancel', 'hold'
Support#

Support for UiAutomator (4.2+)


gsmSignal#

Set GSM signal strength (Emulator only).

Appium command. More details can be found in the official protocol docs.

Usage#
driver.gsmSignal(signalStrength, signalStrengh)
Parameters#
NameTypeDetails
signalStrengthstringsignal strength in the range [0, 4]
signalStrengh
optional
stringsignal 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#

Support for UiAutomator (4.2+)


powerCapacity#

Set the battery percentage (Emulator only).

Appium command. More details can be found in the official protocol docs.

Usage#
driver.powerCapacity(percent)
Parameters#
NameTypeDetails
percentnumberpercentage value in range [0, 100]
Support#

Support for UiAutomator (4.2+)


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.

Usage#
driver.powerAC(state)
Parameters#
NameTypeDetails
statestringset the state. on or off
Support#

Support for UiAutomator (4.2+)


gsmVoice#

Set GSM voice state (Emulator only).

Appium command. More details can be found in the official protocol docs.

Usage#
driver.gsmVoice(state)
Parameters#
NameTypeDetails
statestringstate of GSM voice - 'unregistered', 'home', 'roaming', 'searching', 'denied', 'off', 'on'
Support#

Support for UiAutomator (4.2+)


sendSms#

Simulate an SMS message (Emulator only).

Appium command. More details can be found in the official protocol docs.

Usage#
driver.sendSms(phoneNumber, message)
Parameters#
NameTypeDetails
phoneNumberstringthe phone number to send the SMS too
messagestringthe SMS message
Support#

Support for UiAutomator (4.2+)


fingerPrint#

Authenticate users by using their finger print scans on supported emulators.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.fingerPrint(fingerprintId)
Parameters#
NameTypeDetails
fingerprintIdnumberfinger prints stored in Android Keystore system (from 1 to 10)
Support#

Support for UiAutomator (4.2+)


setClipboard#

Set the content of the system clipboard

Appium command. More details can be found in the official protocol docs.

Usage#
driver.setClipboard(content, contentType, label)
Parameters#
NameTypeDetails
contentstringThe actual base64 encoded clipboard content
contentType
optional
stringThe type of the content to get. Plaintext, Image, URL. Android supports only plaintext
label
optional
stringClipboard data label for Android
Returns#
  • <string> response: Response from Appium server

getClipboard#

Get the content of the system clipboard

Appium command. More details can be found in the official protocol docs.

Usage#
driver.getClipboard(contentType)
Parameters#
NameTypeDetails
contentType
optional
stringThe 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

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.

Usage#
driver.touchPerform(actions)
Parameters#
NameTypeDetails
actionsobject[]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#

Support for UiAutomator (4.2+) Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for 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.

Usage#
driver.multiTouchPerform(actions)
Parameters#
NameTypeDetails
actionsobject[]The type of action to perform (e.g. moveTo, release, press, tap, wait)
Support#

Support for UiAutomator (4.2+) Support for XCUITest (9.3+), UIAutomation (8.0 to 9.3) Support for Windows (10+)


driverScript#

This command allows you to define a webdriverio script in a string and send it to the Appium server to be executed locally to the server itself, thus reducing latency that might otherwise occur along with each command.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.driverScript(script, type, timeout)
Parameters#
NameTypeDetails
scriptstringThe script to execute. It has access to a 'driver' object which represents a webdriverio session attached to the current server.
type
optional
stringThe language/framework used in the script. Currently, only 'webdriverio' is supported and is the default.
timeout
optional
numberThe 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 stored in appium server.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.getEvents(type)
Parameters#
NameTypeDetails
typestring[]Get events which are filtered with the type if the type is provided.
Returns#
  • <object> result: A JSON hash of events like {&#39;commands&#39; =&gt; [{&#39;cmd&#39; =&gt; 123455, ....}], &#39;startTime&#39; =&gt; 1572954894127, }.

logEvent#

Store a custom event.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.logEvent(vendor, event)
Parameters#
NameTypeDetails
vendorstringThe name of vendor. It will be vendor in vendor:event.
eventstringThe name of event. It will be event in vendor:event.

compareImages#

Performs images comparison using OpenCV framework features. It is expected that both OpenCV framework and opencv4nodejs module are installed on the machine where Appium server is running.

Appium command. More details can be found in the official protocol docs.

Usage#
driver.compareImages(mode, firstImage, secondImage, options)
Parameters#
NameTypeDetails
modestringOne of possible comparison modes: 'matchFeatures', 'getSimilarity', 'matchTemplate'. 'matchFeatures' is by default.
firstImagestringAn image data. All image formats, that OpenCV library itself accepts, are supported.
secondImagestringAn image data. All image formats, that OpenCV library itself accepts, are supported.
optionsobjectThe content of this dictionary depends on the actual mode value. See the documentation on appium-support module for more details.
Returns#
  • <object> result: The content of the resulting dictionary depends on the actual mode and options values. See the documentation on appium-support module for more details.