Appium
getContext
Appium command. More details can be found in the official protocol docs.
Usage
driver.getContext()
Returns
- <Context>
context
: a string representing the current context or null representing 'no context'
switchContext
Appium command. More details can be found in the official protocol docs.
Usage
driver.switchContext(name)
Parameters
Name | Type | Details |
---|---|---|
name | string | a string representing an available context |
getContexts
Appium command. More details can be found in the official protocol docs.
Usage
driver.getContexts()
Returns
- <Context[]>
contexts
: an array of strings representing available contexts, e.g. 'WEBVIEW', or 'NATIVE'
shake
Perform a shake action on the device.
Appium command. More details can be found in the official protocol docs.
Usage
driver.shake()
Support
lock
Lock the device.
Appium command. More details can be found in the official protocol docs.
Usage
driver.lock(seconds)
Parameters
Name | Type | Details |
---|---|---|
seconds optional | 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.
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.
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 |
---|---|---|
options optional | 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 |
---|---|---|
remotePath optional | 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. |
username optional | string | The name of the user for the remote authentication. |
password optional | string | The password for the remote authentication. |
method optional | 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.
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.
Usage
driver.getPerformanceData(packageName, dataType, dataReadTimeout)