Skip to main content

Mobile JSON Wire Protocol

getContext

Mobile JSON Wire Protocol command. More details can be found in the official protocol docs.

Usage
driver.getContext()
Returns
  • <string|null> context: a string representing the current context or null representing 'no context'

switchContext

Mobile JSON Wire Protocol command. More details can be found in the official protocol docs.

Usage
driver.switchContext(name)
Parameters
NameTypeDetails
namestringa string representing an available context

getContexts

Mobile JSON Wire Protocol command. More details can be found in the official protocol docs.

Usage
driver.getContexts()
Returns
  • <string[]> contexts: an array of strings representing available contexts, e.g. 'WEBVIEW', or 'NATIVE'

getPageIndex

Mobile JSON Wire Protocol command. More details can be found in the official protocol docs.

Usage
driver.getPageIndex()
Returns
  • <string> pageIndex:

getNetworkConnection

Mobile JSON Wire Protocol command. More details can be found in the official protocol docs.

Usage
driver.getNetworkConnection()
Returns

setNetworkConnection

Mobile JSON Wire Protocol command. More details can be found in the official protocol docs.

Usage
driver.setNetworkConnection(type)
Parameters
NameTypeDetails
typenumbera bit mask that should be translated to an integer value when serialized

touchPerform

Mobile JSON Wire Protocol command. More details can be found in the official protocol docs.

Usage
driver.touchPerform(actions)
Parameters
NameTypeDetails
actionsobject[]a list of objects, each of which represents an input source and its associated actions

multiTouchPerform

Mobile JSON Wire Protocol command. More details can be found in the official protocol docs.

Usage
driver.multiTouchPerform(actions, elementId)
Parameters
NameTypeDetails
actionsobject[]a list of objects, each of which represents an input source and its associated actions
elementId
optional
object[]the id of an element returned in a previous call to Find Element(s)

receiveAsyncResponse

Mobile JSON Wire Protocol command. More details can be found in the official protocol docs.

Usage
driver.receiveAsyncResponse(status, value)
Parameters
NameTypeDetails
statusstringthe expected status of the response
valuestringthe expected value of the response