Skip to content

Interface: ExternalDriver<C, Ctx, CArgs, Settings, CreateResult, DeleteResult, SessionData>

@appium/types.ExternalDriver

External drivers must subclass BaseDriver, and can implement any of these methods. None of these are implemented within Appium itself.

Type parameters

Name Type
C extends Constraints = Constraints
Ctx string
CArgs extends StringRecord = StringRecord
Settings extends StringRecord = StringRecord
CreateResult DefaultCreateSessionResult<C>
DeleteResult DefaultDeleteSessionResult
SessionData extends StringRecord = StringRecord

Hierarchy

  • Driver<C, CArgs, Settings, CreateResult, DeleteResult, SessionData>

ExternalDriver

Table of contents

Properties

Methods

Properties

allowInsecure

allowInsecure: string[]

Inherited from

Driver.allowInsecure

Defined in

packages/types/lib/driver.ts:587


basePath

basePath: string

Inherited from

Driver.basePath

Defined in

packages/types/lib/driver.ts:585


caps

Optional caps: ConstraintsToCaps<C>

The processed capabilities used to start the session represented by the current driver instance

Inherited from

Driver.caps

Defined in

packages/types/lib/driver.ts:719


cliArgs

cliArgs: CArgs

The set of command line arguments set for this driver

Inherited from

Driver.cliArgs

Defined in

packages/types/lib/driver.ts:675


denyInsecure

denyInsecure: string[]

Inherited from

Driver.denyInsecure

Defined in

packages/types/lib/driver.ts:588


desiredCapConstraints

desiredCapConstraints: C

The constraints object used to validate capabilities

Inherited from

Driver.desiredCapConstraints

Defined in

packages/types/lib/driver.ts:729


driverData

driverData: DriverData

Inherited from

Driver.driverData

Defined in

packages/types/lib/driver.ts:596


eventEmitter

eventEmitter: EventEmitter

Inherited from

Driver.eventEmitter

Defined in

packages/types/lib/driver.ts:593


eventHistory

eventHistory: EventHistory

Inherited from

Driver.eventHistory

Defined in

packages/types/lib/driver.ts:598


helpers

helpers: DriverHelpers

Inherited from

Driver.helpers

Defined in

packages/types/lib/driver.ts:584


implicitWaitMs

implicitWaitMs: number

Inherited from

Driver.implicitWaitMs

Defined in

packages/types/lib/driver.ts:590


initialOpts

initialOpts: Object

Type declaration

Name Type
address string
allowCors NonNullable<undefined | boolean>
allowInsecure AllowInsecureConfig
basePath string
callbackAddress undefined | string
callbackPort number
debugLogSpacing NonNullable<undefined | boolean>
defaultCapabilities undefined | DefaultCapabilitiesConfig
denyInsecure DenyInsecureConfig
driver undefined | DriverConfig
fastReset? boolean
keepAliveTimeout number
localTimezone NonNullable<undefined | boolean>
logFile undefined | string
logFilters undefined | LogFiltersConfig
logNoColors NonNullable<undefined | boolean>
logTimestamp NonNullable<undefined | boolean>
loglevel NonNullable<undefined | LogLevelConfig>
longStacktrace NonNullable<undefined | boolean>
noPermsCheck NonNullable<undefined | boolean>
nodeconfig undefined | NodeconfigConfig
plugin undefined | PluginConfig
port number
relaxedSecurityEnabled NonNullable<undefined | boolean>
sessionOverride NonNullable<undefined | boolean>
skipUninstall? boolean
strictCaps NonNullable<undefined | boolean>
tmpDir undefined | string
traceDir undefined | string
useDrivers UseDriversConfig
usePlugins UsePluginsConfig
webhook undefined | string

Inherited from

Driver.initialOpts

Defined in

packages/types/lib/driver.ts:582


isCommandsQueueEnabled

isCommandsQueueEnabled: boolean

Inherited from

Driver.isCommandsQueueEnabled

Defined in

packages/types/lib/driver.ts:597


locatorStrategies

locatorStrategies: string[]

Inherited from

Driver.locatorStrategies

Defined in

packages/types/lib/driver.ts:591


log

log: AppiumLogger

Inherited from

Driver.log

Defined in

packages/types/lib/driver.ts:595


newCommandTimeoutMs

newCommandTimeoutMs: number

Inherited from

Driver.newCommandTimeoutMs

Defined in

packages/types/lib/driver.ts:589


opts

opts: DriverOpts<C>

Inherited from

Driver.opts

Defined in

packages/types/lib/driver.ts:581


originalCaps

Optional originalCaps: W3CCapabilities<C>

The original capabilities used to start the session represented by the current driver instance

Inherited from

Driver.originalCaps

Defined in

packages/types/lib/driver.ts:724


protocol

Optional protocol: Protocol

Inherited from

Driver.protocol

Defined in

packages/types/lib/driver.ts:583


relaxedSecurityEnabled

relaxedSecurityEnabled: boolean

Inherited from

Driver.relaxedSecurityEnabled

Defined in

packages/types/lib/driver.ts:586


server

Optional server: AppiumServer

Inherited from

Driver.server

Defined in

packages/types/lib/driver.ts:677


serverHost

Optional serverHost: string

Inherited from

Driver.serverHost

Defined in

packages/types/lib/driver.ts:678


serverPath

Optional serverPath: string

Inherited from

Driver.serverPath

Defined in

packages/types/lib/driver.ts:680


serverPort

Optional serverPort: number

Inherited from

Driver.serverPort

Defined in

packages/types/lib/driver.ts:679


sessionId

sessionId: null | string

Inherited from

Driver.sessionId

Defined in

packages/types/lib/driver.ts:580


settings

settings: IDeviceSettings<Settings>

Inherited from

Driver.settings

Defined in

packages/types/lib/driver.ts:594


shouldValidateCaps

shouldValidateCaps: boolean

Inherited from

Driver.shouldValidateCaps

Defined in

packages/types/lib/driver.ts:579


supportedLogTypes

supportedLogTypes: Readonly<LogDefRecord>

Definition of the available log types

Inherited from

Driver.supportedLogTypes

Defined in

packages/types/lib/driver.ts:334


updateSettings

updateSettings: (settings: Settings) => Promise<void>

Type declaration

▸ (settings): Promise<void>

Update the session's settings dictionary with a new settings object

Parameters
Name Type Description
settings Settings A key-value map of setting names to values. Settings not named in the map will not have their value adjusted.
Returns

Promise<void>

Inherited from

Driver.updateSettings

Defined in

packages/types/lib/driver.ts:381


webLocatorStrategies

webLocatorStrategies: string[]

Inherited from

Driver.webLocatorStrategies

Defined in

packages/types/lib/driver.ts:592

Methods

activateApp

Optional activateApp(appId, options?): Promise<void>

Launch an app

Parameters

Name Type Description
appId string the package or bundle ID of the application
options? unknown driver-specific launch options

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1419


activateIMEEngine

Optional activateIMEEngine(engine): Promise<void>

Activate an IME engine

Deprecated

Parameters

Name Type Description
engine string the name of the engine

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1673


active

Optional active(): Promise<Element<string>>

Get the active element

See

https://w3c.github.io/webdriver/#get-active-element

Returns

Promise<Element<string>>

The JSON object encapsulating the active element reference

Defined in

packages/types/lib/driver.ts:938


addAuthCredential

Optional addAuthCredential(credentialId, isResidentCredential, rpId, privateKey, userHandle, signCount, authenticatorId): Promise<void>

Inject a public key credential source into a virtual authenticator

See

https://www.w3.org/TR/webauthn-2/#sctn-automation-add-credential

Parameters

Name Type Description
credentialId string the base64 encoded credential ID
isResidentCredential boolean if true, a client-side credential, otherwise a server-side credential
rpId string the relying party ID the credential is scoped to
privateKey string the base64 encoded private key package
userHandle string the base64 encoded user handle
signCount number the initial value for a signature counter
authenticatorId string -

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1934


addManagedDriver

addManagedDriver(driver): void

Parameters

Name Type
driver Driver<Constraints, StringRecord, StringRecord, DefaultCreateSessionResult<Constraints>, void, StringRecord>

Returns

void

Inherited from

Driver.addManagedDriver

Defined in

packages/types/lib/driver.ts:642


addVirtualAuthenticator

Optional addVirtualAuthenticator(protocol, transport, hasResidentKey?, hasUserVerification?, isUserConsenting?, isUserVerified?): Promise<string>

Add a virtual authenticator to a browser

See

https://www.w3.org/TR/webauthn-2/#sctn-automation-add-virtual-authenticator

Parameters

Name Type Description
protocol "ctap/u2f" | "ctap2" | "ctap2_1" the protocol
transport string a valid AuthenticatorTransport value
hasResidentKey? boolean whether there is a resident key
hasUserVerification? boolean whether the authenticator has user verification
isUserConsenting? boolean whether it is a user consenting authenticator
isUserVerified? boolean whether the user is verified

Returns

Promise<string>

The authenticator ID

Defined in

packages/types/lib/driver.ts:1905


assertFeatureEnabled

assertFeatureEnabled(name): void

Parameters

Name Type
name string

Returns

void

Inherited from

Driver.assertFeatureEnabled

Defined in

packages/types/lib/driver.ts:636


assignServer

Optional assignServer(server, host, port, path): void

A helper function used to assign server information to the driver instance so the driver knows where the server is Running

Parameters

Name Type Description
server AppiumServer the server object
host string the server hostname
port number the server port
path string the server base url

Returns

void

Inherited from

Driver.assignServer

Defined in

packages/types/lib/driver.ts:760


availableIMEEngines

Optional availableIMEEngines(): Promise<string[]>

Get the list of IME engines

Deprecated

Returns

Promise<string[]>

The list of IME engines

Defined in

packages/types/lib/driver.ts:1639


back

Optional back(): Promise<void>

Navigate back in the page history

See

https://w3c.github.io/webdriver/#back

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:798


buttonDown

Optional buttonDown(button?): Promise<void>

Trigger a mouse button down

Deprecated

Use the Actions API instead

Parameters

Name Type Description
button? number the button ID

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1697


buttonUp

Optional buttonUp(button?): Promise<void>

Trigger a mouse button up

Deprecated

Use the Actions API instead

Parameters

Name Type Description
button? number the button ID

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1707


canProxy

canProxy(sessionId?): boolean

Parameters

Name Type
sessionId? string

Returns

boolean

Inherited from

Driver.canProxy

Defined in

packages/types/lib/driver.ts:640


clear

Optional clear(elementId): Promise<void>

Clear the text/value of an editable element

See

https://w3c.github.io/webdriver/#element-clear

Parameters

Name Type Description
elementId string the id of the element

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1077


clearNewCommandTimeout

clearNewCommandTimeout(): Promise<void>

Returns

Promise<void>

Inherited from

Driver.clearNewCommandTimeout

Defined in

packages/types/lib/driver.ts:644


click

Optional click(elementId): Promise<void>

Click/tap an element

See

https://w3c.github.io/webdriver/#element-click

Parameters

Name Type Description
elementId string the id of the element

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1069


clickCurrent

Optional clickCurrent(button?): Promise<void>

Click the current mouse location

Deprecated

Use the Actions API instead

Parameters

Name Type Description
button? number the button ID

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1717


closeWindow

Optional closeWindow(): Promise<string[]>

Close the current browsing context (window)

See

https://w3c.github.io/webdriver/#close-window

Returns

Promise<string[]>

An array of window handles representing currently-open windows

Defined in

packages/types/lib/driver.ts:845


createNewWindow

Optional createNewWindow(type?): Promise<NewWindow>

Create a new browser window

See

https://w3c.github.io/webdriver/#new-window

Parameters

Name Type Description
type? NewWindowType a hint to the driver whether to create a "tab" or "window"

Returns

Promise<NewWindow>

An object containing the handle of the newly created window and its type

Defined in

packages/types/lib/driver.ts:871


createSession

createSession(w3cCaps1, w3cCaps2?, w3cCaps3?, driverData?): Promise<CreateResult>

Start a new automation session

See

https://w3c.github.io/webdriver/#new-session

Parameters

Name Type Description
w3cCaps1 W3CDriverCaps<C> the new session capabilities
w3cCaps2? W3CDriverCaps<C> another place the new session capabilities could be sent (typically left undefined)
w3cCaps3? W3CDriverCaps<C> another place the new session capabilities could be sent (typically left undefined)
driverData? DriverData[] a list of DriverData objects representing other sessions running for this driver on the same Appium server. This information can be used to help ensure no conflict of resources

Returns

Promise<CreateResult>

The capabilities object representing the created session

Inherited from

Driver.createSession

Defined in

packages/types/lib/driver.ts:430


deactivateIMEEngine

Optional deactivateIMEEngine(): Promise<void>

Deactivate an IME engine

Deprecated

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1664


deleteCookie

Optional deleteCookie(name): Promise<void>

Delete a named cookie

See

https://w3c.github.io/webdriver/#delete-cookie

Parameters

Name Type Description
name string the name of the cookie to delete

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1146


deleteCookies

Optional deleteCookies(): Promise<void>

Delete all cookies

See

https://w3c.github.io/webdriver/#delete-all-cookies

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1152


deleteSession

deleteSession(sessionId?, driverData?): Promise<void | DeleteResult>

Stop an automation session

See

https://w3c.github.io/webdriver/#delete-session

Parameters

Name Type Description
sessionId? string the id of the session that is to be deleted
driverData? DriverData[] the driver data for other currently-running sessions

Returns

Promise<void | DeleteResult>

Inherited from

Driver.deleteSession

Defined in

packages/types/lib/driver.ts:444


doubleClick

Optional doubleClick(): Promise<void>

Double-click the current mouse location

Deprecated

Use the Actions API instead

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1725


driverForSession

driverForSession(sessionId): null | Core<Constraints, StringRecord>

Parameters

Name Type
sessionId string

Returns

null | Core<Constraints, StringRecord>

Inherited from

Driver.driverForSession

Defined in

packages/types/lib/driver.ts:646


elementDisplayed

Optional elementDisplayed(elementId): Promise<boolean>

Determine whether an element is displayed

See

https://w3c.github.io/webdriver/#element-displayedness

Parameters

Name Type Description
elementId string the id of the element

Returns

Promise<boolean>

True if any part of the element is rendered within the viewport, False otherwise

Defined in

packages/types/lib/driver.ts:1061


elementEnabled

Optional elementEnabled(elementId): Promise<boolean>

Determine whether an element is enabled

See

https://w3c.github.io/webdriver/#is-element-enabled

Parameters

Name Type Description
elementId string the id of the element

Returns

Promise<boolean>

True if the element is enabled, False otherwise

Defined in

packages/types/lib/driver.ts:1031


elementSelected

Optional elementSelected(elementId): Promise<boolean>

Determine if the reference element is selected or not

See

https://w3c.github.io/webdriver/#is-element-selected

Parameters

Name Type Description
elementId string the id of the element

Returns

Promise<boolean>

True if the element is selected, False otherwise

Defined in

packages/types/lib/driver.ts:958


elementShadowRoot

Optional elementShadowRoot(elementId): Promise<Element<string>>

Get the shadow root of an element

See

https://w3c.github.io/webdriver/#get-element-shadow-root

Parameters

Name Type Description
elementId string the id of the element to retrieve the shadow root for

Returns

Promise<Element<string>>

The shadow root for an element, as an element

Defined in

packages/types/lib/driver.ts:948


endCoverage

Optional endCoverage(intent, path): Promise<void>

End platform-specific code coverage tracing

Deprecated

Parameters

Name Type Description
intent string the Android intent for the coverage activity
path string the path to place the results

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1605


equalsElement

Optional equalsElement(elementId, otherElementId): Promise<boolean>

Check whether two elements are identical

Deprecated

Parameters

Name Type Description
elementId string the first element's ID
otherElementId string the second element's ID

Returns

Promise<boolean>

True if the elements are equal, false otherwise

Defined in

packages/types/lib/driver.ts:1630


execute

Optional execute(script, args): Promise<unknown>

Execute JavaScript (or some other kind of script) in the browser/app context

See

https://w3c.github.io/webdriver/#execute-script

Parameters

Name Type Description
script string the string to be evaluated as the script, which will be made the body of an anonymous function in the case of JS
args unknown[] the list of arguments to be applied to the script as a function

Returns

Promise<unknown>

The return value of the script execution

Defined in

packages/types/lib/driver.ts:1098


executeAsync

Optional executeAsync(script, args): Promise<unknown>

Execute JavaScript (or some other kind of script) in the browser/app context, asynchronously

See

https://w3c.github.io/webdriver/#execute-async-script

Parameters

Name Type Description
script string the string to be evaluated as the script, which will be made the body of an anonymous function in the case of JS
args unknown[] the list of arguments to be applied to the script as a function

Returns

Promise<unknown>

The promise resolution of the return value of the script execution (or an error object if the promise is rejected)

Defined in

packages/types/lib/driver.ts:1111


executeCdp

Optional executeCdp(cmd, params): Promise<unknown>

Execute a devtools command

Parameters

Name Type Description
cmd string the command
params unknown any command-specific command parameters

Returns

Promise<unknown>

The result of the command execution

Defined in

packages/types/lib/driver.ts:1888


executeCommand

executeCommand(cmd, ...args): Promise<any>

Execute a driver (WebDriver-protocol) command by its name as defined in the routes file

Parameters

Name Type Description
cmd string the name of the command
...args any[] arguments to pass to the command

Returns

Promise<any>

The result of running the command

Inherited from

Driver.executeCommand

Defined in

packages/types/lib/driver.ts:692


executeMethod

executeMethod<TArgs, TReturn>(script, args): Promise<TReturn>

Call an Execute Method by its name with the given arguments. This method will check that the driver has registered the method matching the name, and send it the arguments.

Type parameters

Name Type
TArgs extends readonly any[] | readonly [StringRecord<unknown>] = unknown[]
TReturn unknown

Parameters

Name Type Description
script string the name of the Execute Method
args TArgs a singleton array containing an arguments object

Returns

Promise<TReturn>

The result of calling the Execute Method

Inherited from

Driver.executeMethod

Defined in

packages/types/lib/driver.ts:170


findElOrEls

findElOrEls(strategy, selector, mult, context?): Promise<Element<string>[]>

A helper method that returns one or more UI elements based on the search criteria

Parameters

Name Type Description
strategy string the locator strategy
selector string the selector
mult true whether or not we want to find multiple elements
context? any the element to use as the search context basis if desiredCapabilities

Returns

Promise<Element<string>[]>

A single element or list of elements

Inherited from

Driver.findElOrEls

Defined in

packages/types/lib/driver.ts:294

findElOrEls(strategy, selector, mult, context?): Promise<Element<string>>

Parameters

Name Type
strategy string
selector string
mult false
context? any

Returns

Promise<Element<string>>

Inherited from

Driver.findElOrEls

Defined in

packages/types/lib/driver.ts:295


findElOrElsWithProcessing

findElOrElsWithProcessing(strategy, selector, mult, context?): Promise<Element<string>[]>

This is a wrapper for findElOrEls that validates locator strategies and implements the appium:printPageSourceOnFindFailure capability

Parameters

Name Type Description
strategy string the locator strategy
selector string the selector
mult true whether or not we want to find multiple elements
context? any the element to use as the search context basis if desiredCapabilities

Returns

Promise<Element<string>[]>

A single element or list of elements

Inherited from

Driver.findElOrElsWithProcessing

Defined in

packages/types/lib/driver.ts:308

findElOrElsWithProcessing(strategy, selector, mult, context?): Promise<Element<string>>

Parameters

Name Type
strategy string
selector string
mult false
context? any

Returns

Promise<Element<string>>

Inherited from

Driver.findElOrElsWithProcessing

Defined in

packages/types/lib/driver.ts:314


findElement

findElement(strategy, selector): Promise<Element<string>>

Find a UI element given a locator strategy and a selector, erroring if it can't be found

See

https://w3c.github.io/webdriver/#find-element

Parameters

Name Type Description
strategy string the locator strategy
selector string the selector to combine with the strategy to find the specific element

Returns

Promise<Element<string>>

The element object encoding the element id which can be used in element-related commands

Inherited from

Driver.findElement

Defined in

packages/types/lib/driver.ts:210


findElementFromElement

findElementFromElement(strategy, selector, elementId): Promise<Element<string>>

Find a UI element given a locator strategy and a selector, erroring if it can't be found. Only look for elements among the set of descendants of a given element

See

https://w3c.github.io/webdriver/#find-element-from-element

Parameters

Name Type Description
strategy string the locator strategy
selector string the selector to combine with the strategy to find the specific element
elementId string the id of the element to use as the search basis

Returns

Promise<Element<string>>

The element object encoding the element id which can be used in element-related commands

Inherited from

Driver.findElementFromElement

Defined in

packages/types/lib/driver.ts:235


findElementFromShadowRoot

Optional findElementFromShadowRoot(strategy, selector, shadowId): Promise<Element<string>>

Find an element from a shadow root

See

https://w3c.github.io/webdriver/#find-element-from-shadow-root

Parameters

Name Type Description
strategy string the locator strategy
selector string the selector to combine with the strategy to find the specific elements
shadowId string the id of the element to use as the search basis

Returns

Promise<Element<string>>

The element inside the shadow root matching the selector

Inherited from

Driver.findElementFromShadowRoot

Defined in

packages/types/lib/driver.ts:263


findElements

findElements(strategy, selector): Promise<Element<string>[]>

Find a a list of all UI elements matching a given a locator strategy and a selector

See

https://w3c.github.io/webdriver/#find-elements

Parameters

Name Type Description
strategy string the locator strategy
selector string the selector to combine with the strategy to find the specific elements

Returns

Promise<Element<string>[]>

A possibly-empty list of element objects

Inherited from

Driver.findElements

Defined in

packages/types/lib/driver.ts:221


findElementsFromElement

findElementsFromElement(strategy, selector, elementId): Promise<Element<string>[]>

Find a a list of all UI elements matching a given a locator strategy and a selector. Only look for elements among the set of descendants of a given element

See

https://w3c.github.io/webdriver/#find-elements-from-element

Parameters

Name Type Description
strategy string the locator strategy
selector string the selector to combine with the strategy to find the specific elements
elementId string the id of the element to use as the search basis

Returns

Promise<Element<string>[]>

A possibly-empty list of element objects

Inherited from

Driver.findElementsFromElement

Defined in

packages/types/lib/driver.ts:248


findElementsFromShadowRoot

Optional findElementsFromShadowRoot(strategy, selector, shadowId): Promise<Element<string>[]>

Find elements from a shadow root

See

https://w3c.github.io/webdriver/#find-element-from-shadow-root

Parameters

Name Type Description
strategy string the locator strategy
selector string the selector to combine with the strategy to find the specific elements
shadowId string the id of the element to use as the search basis

Returns

Promise<Element<string>[]>

A possibly empty list of elements inside the shadow root matching the selector

Inherited from

Driver.findElementsFromShadowRoot

Defined in

packages/types/lib/driver.ts:278


fingerprint

Optional fingerprint(fingerprintId): Promise<void>

Apply a synthetic fingerprint to the fingerprint detector of the device

Deprecated

Parameters

Name Type Description
fingerprintId number the numeric ID of the fingerprint to use

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1283


flick

Optional flick(element?, xSpeed?, ySpeed?, xOffset?, yOffset?, speed?): Promise<void>

Perform a flick event at the location specified

Deprecated

Use the Actions API instead

Parameters

Name Type Description
element? string the element to make coordinates relative to
xSpeed? number the horizontal flick speed (in driver-specific units)
ySpeed? number the vertical flick speed (in driver-specific units)
xOffset? number the x coordinate
yOffset? number the y coordinate
speed? number the speed (unclear how this relates to xSpeed and ySpeed)

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1779


forward

Optional forward(): Promise<void>

Navigate forward in the page history

See

https://w3c.github.io/webdriver/#forward

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:804


fullScreenWindow

Optional fullScreenWindow(): Promise<Rect>

Put the current window into full screen mode

See

https://w3c.github.io/webdriver/#fullscreen-window

Returns

Promise<Rect>

The actual Rect of the window after running the command

Defined in

packages/types/lib/driver.ts:930


getActiveIMEEngine

Optional getActiveIMEEngine(): Promise<string>

Get the active IME engine

Deprecated

Returns

Promise<string>

The name of the active engine

Defined in

packages/types/lib/driver.ts:1648


getAlertText

Optional getAlertText(): Promise<null | string>

Get the text of the displayed alert

See

https://w3c.github.io/webdriver/#get-alert-text

Returns

Promise<null | string>

The text of the alert

Defined in

packages/types/lib/driver.ts:1186


getAttribute

Optional getAttribute(name, elementId): Promise<null | string>

Retrieve the value of an element's attribute

See

https://w3c.github.io/webdriver/#get-element-attribute

Parameters

Name Type Description
name string the attribute name
elementId string the id of the element

Returns

Promise<null | string>

The attribute value

Defined in

packages/types/lib/driver.ts:969


getAuthCredential

Optional getAuthCredential(): Promise<Credential[]>

Get the list of public key credential sources

See

https://www.w3.org/TR/webauthn-2/#sctn-automation-get-credentials

Returns

Promise<Credential[]>

The list of Credentials

Defined in

packages/types/lib/driver.ts:1950


getComputedLabel

Optional getComputedLabel(elementId): Promise<null | string>

Get the accessible name/label of an element

See

https://w3c.github.io/webdriver/#get-computed-label

Parameters

Name Type Description
elementId string the id of the element

Returns

Promise<null | string>

The accessible name

Defined in

packages/types/lib/driver.ts:1051


getComputedRole

Optional getComputedRole(elementId): Promise<null | string>

Get the WAI-ARIA role of an element

See

https://w3c.github.io/webdriver/#get-computed-role

Parameters

Name Type Description
elementId string the id of the element

Returns

Promise<null | string>

The role

Defined in

packages/types/lib/driver.ts:1041


getContexts

Optional getContexts(): Promise<Ctx[]>

Get the list of available contexts

See

https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#webviews-and-other-contexts

Returns

Promise<Ctx[]>

The list of context names

Defined in

packages/types/lib/driver.ts:1827


getCookie

Optional getCookie(name): Promise<Cookie>

Get a cookie by name

See

https://w3c.github.io/webdriver/#get-named-cookie

Parameters

Name Type Description
name string the name of the cookie

Returns

Promise<Cookie>

A serialized cookie

Defined in

packages/types/lib/driver.ts:1129


getCookies

Optional getCookies(): Promise<Cookie[]>

Get all cookies known to the browsing context

See

https://w3c.github.io/webdriver/#get-all-cookies

Returns

Promise<Cookie[]>

A list of serialized cookies

Defined in

packages/types/lib/driver.ts:1119


getCssProperty

Optional getCssProperty(name, elementId): Promise<string>

Retrieve the value of a CSS property of an element

See

https://w3c.github.io/webdriver/#get-element-css-value

Parameters

Name Type Description
name string the CSS property name
elementId string the id of the element

Returns

Promise<string>

The property value

Defined in

packages/types/lib/driver.ts:991


getCurrentActivity

Optional getCurrentActivity(): Promise<string>

Get the current activity name

Deprecated

Returns

Promise<string>

The activity name

Defined in

packages/types/lib/driver.ts:1393


getCurrentContext

Optional getCurrentContext(): Promise<null | Ctx>

Get the currently active context

See

https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#webviews-and-other-contexts

Returns

Promise<null | Ctx>

The context name

Defined in

packages/types/lib/driver.ts:1811


getCurrentPackage

Optional getCurrentPackage(): Promise<string>

Get the current active app package name/id

Deprecated

Returns

Promise<string>

The package name

Defined in

packages/types/lib/driver.ts:1403


getDeviceTime

Optional getDeviceTime(format?): Promise<string>

Get the current time on the device under timeouts

Parameters

Name Type Description
format? string the date/time format you would like the response into

Returns

Promise<string>

The formatted time

Defined in

packages/types/lib/driver.ts:1223


getDisplayDensity

Optional getDisplayDensity(): Promise<number>

Get the display's pixel density

Deprecated

Returns

Promise<number>

The density

Defined in

packages/types/lib/driver.ts:1594


getElementRect

Optional getElementRect(elementId): Promise<Rect>

Get the dimensions and position of an element

See

https://w3c.github.io/webdriver/#get-element-rect

Parameters

Name Type Description
elementId string the id of the element

Returns

Promise<Rect>

The Rect object containing x, y, width, and height properties

Defined in

packages/types/lib/driver.ts:1021


getElementScreenshot

Optional getElementScreenshot(elementId): Promise<string>

Get an image of a single element as rendered on screen

See

https://w3c.github.io/webdriver/#take-element-screenshot

Parameters

Name Type Description
elementId string the id of the element

Returns

Promise<string>

A base64-encoded string representing the PNG image data for the element rect

Defined in

packages/types/lib/driver.ts:1212


getGeoLocation

Optional getGeoLocation(): Promise<Location>

Get the virtual or real geographical location of a device

Returns

Promise<Location>

The location

Defined in

packages/types/lib/driver.ts:1793


getLog

getLog(logType): Promise<any>

Get the log for a given log type.

Parameters

Name Type Description
logType string Name/key of log type as defined in supportedLogTypes.

Returns

Promise<any>

Inherited from

Driver.getLog

Defined in

packages/types/lib/driver.ts:346


getLogEvents

getLogEvents(type?): Promise<EventHistory | Record<string, number>>

Get a list of events that have occurred in the current session

Parameters

Name Type Description
type? string | string[] filter the returned events by including one or more types

Returns

Promise<EventHistory | Record<string, number>>

The event history for the session

Inherited from

Driver.getLogEvents

Defined in

packages/types/lib/driver.ts:157


getLogTypes

getLogTypes(): Promise<string[]>

Get available log types as a list of strings

Returns

Promise<string[]>

Inherited from

Driver.getLogTypes

Defined in

packages/types/lib/driver.ts:339


getManagedDrivers

getManagedDrivers(): Driver<Constraints, StringRecord, StringRecord, DefaultCreateSessionResult<Constraints>, void, StringRecord>[]

Returns

Driver<Constraints, StringRecord, StringRecord, DefaultCreateSessionResult<Constraints>, void, StringRecord>[]

Inherited from

Driver.getManagedDrivers

Defined in

packages/types/lib/driver.ts:643


getName

Optional getName(elementId): Promise<string>

Get the tag name of an element

See

https://w3c.github.io/webdriver/#get-element-tag-name

Parameters

Name Type Description
elementId string the id of the element

Returns

Promise<string>

The tag name

Defined in

packages/types/lib/driver.ts:1011


getNetworkConnection

Optional getNetworkConnection(): Promise<number>

Get the network connection state of a device

See

https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes

Returns

Promise<number>

A number which is a bitmask representing categories like Data, Wifi, and Airplane mode status

Defined in

packages/types/lib/driver.ts:1848


getOrientation

Optional getOrientation(): Promise<string>

Get the device orientation

Returns

Promise<string>

The orientation string

Defined in

packages/types/lib/driver.ts:1680


getPageIndex

Optional getPageIndex(elementId): Promise<string>

Get the index of an element on the page

Deprecated

Parameters

Name Type Description
elementId string the element id

Returns

Promise<string>

The page index

Defined in

packages/types/lib/driver.ts:1839


getPageSource

getPageSource(): Promise<string>

Get the current page/app source as HTML/XML

See

https://w3c.github.io/webdriver/#get-page-source

Returns

Promise<string>

The UI hierarchy in a platform-appropriate format (e.g., HTML for a web page)

Inherited from

Driver.getPageSource

Defined in

packages/types/lib/driver.ts:327


getPerformanceData

Optional getPerformanceData(packageName, dataType, dataReadTimeout?): Promise<any>

Get the list of performance data associated with a given type

Deprecated

Parameters

Name Type Description
packageName string the package name / id of the app to retrieve data for
dataType string the performance data type; one of those retrieved in a call to getPerformanceDataTypes
dataReadTimeout? number how long to wait for data before timing out

Returns

Promise<any>

A list of performance data strings

Defined in

packages/types/lib/driver.ts:1247


getPerformanceDataTypes

Optional getPerformanceDataTypes(): Promise<string[]>

List the performance data types supported by this driver, which can be used in a call to get the performance data by type.

Deprecated

Returns

Promise<string[]>

The list of types

Defined in

packages/types/lib/driver.ts:1233


getProperty

Optional getProperty(name, elementId): Promise<null | string>

Retrieve the value of a named property of an element's JS object

See

https://w3c.github.io/webdriver/#get-element-property

Parameters

Name Type Description
name string the object property name
elementId string the id of the element

Returns

Promise<null | string>

The property value

Defined in

packages/types/lib/driver.ts:980


getProxyAvoidList

getProxyAvoidList(sessionId?): RouteMatcher[]

Parameters

Name Type
sessionId? string

Returns

RouteMatcher[]

Inherited from

Driver.getProxyAvoidList

Defined in

packages/types/lib/driver.ts:639


getRotation

Optional getRotation(): Promise<Rotation>

Get the current rotation state of the device

See

https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-rotation

Returns

Promise<Rotation>

The Rotation object consisting of x, y, and z rotation values (0 <= n <= 360)

Defined in

packages/types/lib/driver.ts:1866


getScreenshot

Optional getScreenshot(): Promise<string>

Get a screenshot of the current document as rendered

See

https://w3c.github.io/webdriver/#take-screenshot

Returns

Promise<string>

A base64-encoded string representing the PNG image data

Defined in

packages/types/lib/driver.ts:1202


getSession

getSession(): Promise<SingularSessionData<C, SessionData>>

Get the data for the current session

Returns

Promise<SingularSessionData<C, SessionData>>

A session data object

Inherited from

Driver.getSession

Defined in

packages/types/lib/driver.ts:458


getSessions

getSessions(): Promise<MultiSessionData<Constraints>[]>

Get data for all sessions running on an Appium server

Returns

Promise<MultiSessionData<Constraints>[]>

A list of session data objects

Inherited from

Driver.getSessions

Defined in

packages/types/lib/driver.ts:451


getSettings

getSettings(): Promise<Settings>

Get the current settings for the session

Returns

Promise<Settings>

The settings object

Inherited from

Driver.getSettings

Defined in

packages/types/lib/driver.ts:388


getStatus

getStatus(): Promise<any>

Summary

Retrieve the server's current status.

Description

Returns information about whether a remote end is in a state in which it can create new sessions and can additionally include arbitrary meta information that is specific to the implementation.

The readiness state is represented by the ready property of the body, which is false if an attempt to create a session at the current time would fail. However, the value true does not guarantee that a New Session command will succeed.

Implementations may optionally include additional meta information as part of the body, but the top-level properties ready and message are reserved and must not be overwritten.

Example

// webdriver.io example
await driver.status();
driver.get_status()
driver.getStatus();
# ruby_lib example
remote_status

# ruby_lib_core example
@driver.remote_status

Returns

Promise<any>

Inherited from

Driver.getStatus

Defined in

packages/types/lib/driver.ts:631


getSystemBars

Optional getSystemBars(): Promise<unknown>

Get information from the system bars of a device

Deprecated

Returns

Promise<unknown>

An array of information objects of driver-specific shape

Defined in

packages/types/lib/driver.ts:1584


getText

Optional getText(elementId): Promise<string>

Get the text of an element as rendered

See

https://w3c.github.io/webdriver/#get-element-text

Parameters

Name Type Description
elementId string the id of the element

Returns

Promise<string>

The text rendered for the element

Defined in

packages/types/lib/driver.ts:1001


getTimeouts

getTimeouts(): Promise<Record<string, number>>

Get the current timeouts

See

https://w3c.github.io/webdriver/#get-timeouts

Returns

Promise<Record<string, number>>

A map of timeout names to ms values

Inherited from

Driver.getTimeouts

Defined in

packages/types/lib/driver.ts:77


getUrl

Optional getUrl(): Promise<string>

Get the current url

See

https://w3c.github.io/webdriver/#get-current-url

Returns

Promise<string>

The url

Defined in

packages/types/lib/driver.ts:792


getWindowHandle

Optional getWindowHandle(): Promise<string>

Get the handle (id) associated with the current browser window

See

https://w3c.github.io/webdriver/#get-window-handle

Returns

Promise<string>

The handle string

Defined in

packages/types/lib/driver.ts:837


getWindowHandles

Optional getWindowHandles(): Promise<string[]>

Get a set of handles representing open browser windows

See

https://w3c.github.io/webdriver/#get-window-handles

Returns

Promise<string[]>

An array of window handles representing currently-open windows

Defined in

packages/types/lib/driver.ts:861


getWindowRect

Optional getWindowRect(): Promise<Rect>

Get the size and position of the current window

See

https://w3c.github.io/webdriver/#get-window-rect

Returns

Promise<Rect>

A Rect JSON object with x, y, width, and height properties

Defined in

packages/types/lib/driver.ts:893


gsmCall

Optional gsmCall(phoneNumber, action): Promise<void>

Simulate triggering a phone call from a phone number and having the device take an action in response

Deprecated

Parameters

Name Type Description
phoneNumber string the number to pretend the call is from
action string the action to take in response (accept, reject, etc...)

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1304


gsmSignal

Optional gsmSignal(signalStrength): Promise<void>

Simulate setting the GSM signal strength for a cell phone

Deprecated

Parameters

Name Type
signalStrength string | number

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1313


gsmVoice

Optional gsmVoice(state): Promise<void>

Do something with GSM voice (unclear; this should not be implemented anywhere)

Deprecated

Parameters

Name Type Description
state string the state

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1323


hideKeyboard

Optional hideKeyboard(strategy?, key?, keyCode?, keyName?): Promise<boolean>

Attempt to hide a virtual keyboard

Parameters

Name Type Description
strategy? string the driver-specific name of a hiding strategy to follow
key? string the text of a key to use to hide the keyboard
keyCode? string a key code to trigger to hide the keyboard
keyName? string the name of a key to use to hide the keyboard

Returns

Promise<boolean>

Whether the keyboard was successfully hidden. May never return false on some platforms

Defined in

packages/types/lib/driver.ts:1467


implicitWait

implicitWait(ms): Promise<void>

Set the implicit wait timeout

Deprecated

Use timeouts instead

Parameters

Name Type Description
ms string | number the timeout in ms

Returns

Promise<void>

Inherited from

Driver.implicitWait

Defined in

packages/types/lib/driver.ts:53


implicitWaitForCondition

implicitWaitForCondition(condition): Promise<unknown>

Periodically retry an async function up until the currently set implicit wait timeout

Parameters

Name Type Description
condition (...args: any[]) => Promise<any> the behaviour to retry until it returns truthy

Returns

Promise<unknown>

The return value of the condition

Inherited from

Driver.implicitWaitForCondition

Defined in

packages/types/lib/driver.ts:69


implicitWaitMJSONWP

implicitWaitMJSONWP(ms): Promise<void>

Set the implicit wait value that was sent in via the JSONWP

Deprecated

Parameters

Name Type Description
ms number the timeout in ms

Returns

Promise<void>

Inherited from

Driver.implicitWaitMJSONWP

Defined in

packages/types/lib/driver.ts:92


implicitWaitW3C

implicitWaitW3C(ms): Promise<void>

Set the implicit wait value that was sent in via the W3C protocol

Parameters

Name Type Description
ms number the timeout in ms

Returns

Promise<void>

Inherited from

Driver.implicitWaitW3C

Defined in

packages/types/lib/driver.ts:84


installApp

Optional installApp(appPath, options?): Promise<void>

Install an app on a device

Parameters

Name Type Description
appPath string the absolute path to a local app or a URL of a downloadable app bundle
options? unknown driver-specific install options

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1411


isAppInstalled

Optional isAppInstalled(appId): Promise<boolean>

Determine whether an app is installed

Parameters

Name Type Description
appId string the package or bundle ID of the application

Returns

Promise<boolean>

Defined in

packages/types/lib/driver.ts:1444


isFeatureEnabled

isFeatureEnabled(name): boolean

Parameters

Name Type
name string

Returns

boolean

Inherited from

Driver.isFeatureEnabled

Defined in

packages/types/lib/driver.ts:635


isIMEActivated

Optional isIMEActivated(): Promise<boolean>

Determine whether an IME is active

Deprecated

Returns

Promise<boolean>

True if the IME is activated

Defined in

packages/types/lib/driver.ts:1657


isKeyboardShown

Optional isKeyboardShown(): Promise<boolean>

Determine whether the keyboard is shown

Returns

Promise<boolean>

Whether the keyboard is shown

Defined in

packages/types/lib/driver.ts:1479


isMjsonwpProtocol

isMjsonwpProtocol(): boolean

Returns

boolean

Inherited from

Driver.isMjsonwpProtocol

Defined in

packages/types/lib/driver.ts:634


isW3CProtocol

isW3CProtocol(): boolean

Returns

boolean

Inherited from

Driver.isW3CProtocol

Defined in

packages/types/lib/driver.ts:633


keyevent

Optional keyevent(keycode, metastate?): Promise<void>

Simulate a keyevent on the device

Deprecated

Parameters

Name Type Description
keycode string | number the manufacturer defined keycode
metastate? string | number the combination of meta startUnexpectedShutdown

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1360


logCustomEvent

logCustomEvent(vendor, event): Promise<void>

Add a custom-named event to the Appium event log

Parameters

Name Type Description
vendor string the name of the vendor or tool the event belongs to, to namespace the event
event string the name of the event itself

Returns

Promise<void>

Inherited from

Driver.logCustomEvent

Defined in

packages/types/lib/driver.ts:148


logEvent

logEvent(eventName): void

Parameters

Name Type
eventName string

Returns

void

Inherited from

Driver.logEvent

Defined in

packages/types/lib/driver.ts:645


logExtraCaps

logExtraCaps(caps): void

A helper function to log unrecognized capabilities to the console

Params

caps - the capabilities

Parameters

Name Type
caps DriverCaps<C>

Returns

void

Inherited from

Driver.logExtraCaps

Defined in

packages/types/lib/driver.ts:749


longPressKeyCode

Optional longPressKeyCode(keycode, metastate?, flags?): Promise<void>

Press a device hardware key by its code for a longer duration

Deprecated

Parameters

Name Type Description
keycode number the keycode
metastate? number the code denoting the simultaneous pressing of any meta keys (shift etc)
flags? number the code denoting the combination of extra flags

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1274


maximizeWindow

Optional maximizeWindow(): Promise<Rect>

Run the window-manager specific 'maximize' operation on the current window

See

https://w3c.github.io/webdriver/#maximize-window

Returns

Promise<Rect>

The actual Rect of the window after running the command

Defined in

packages/types/lib/driver.ts:914


minimizeWindow

Optional minimizeWindow(): Promise<Rect>

Run the window-manager specific 'minimize' operation on the current window

See

https://w3c.github.io/webdriver/#minimize-window

Returns

Promise<Rect>

The actual Rect of the window after running the command

Defined in

packages/types/lib/driver.ts:922


mobileRotation

Optional mobileRotation(x, y, radius, rotation, touchCount, duration, elementId?): Promise<void>

Construct a rotation gesture? Unclear what this command does and it does not appear to be used

Deprecated

Use setRotation instead

Parameters

Name Type Description
x number the x coordinate of the rotation center
y number the y coordinate of the rotation center
radius number the radius of the rotation circle
rotation number the rotation angle? idk
touchCount number how many fingers to rotate
duration string -
elementId? string if we're rotating around an element

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1375


networkSpeed

Optional networkSpeed(netspeed): Promise<void>

Set the network speed of the device

Deprecated

Parameters

Name Type Description
netspeed string the speed as a string, like '3G'

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1350


newCommandTimeout

newCommandTimeout(ms): Promise<void>

Set Appium's new command timeout

Parameters

Name Type Description
ms number the timeout in ms

Returns

Promise<void>

Inherited from

Driver.newCommandTimeout

Defined in

packages/types/lib/driver.ts:129


onUnexpectedShutdown

onUnexpectedShutdown(handler): void

Parameters

Name Type
handler () => any

Returns

void

Inherited from

Driver.onUnexpectedShutdown

Defined in

packages/types/lib/driver.ts:599


openNotifications

Optional openNotifications(): Promise<void>

Open the notifications shade/screen

Deprecated

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1545


pageLoadTimeoutMJSONWP

pageLoadTimeoutMJSONWP(ms): Promise<void>

Set the page load timeout value that was sent in via the JSONWP

Deprecated

Parameters

Name Type Description
ms number the timeout in ms

Returns

Promise<void>

Inherited from

Driver.pageLoadTimeoutMJSONWP

Defined in

packages/types/lib/driver.ts:107


pageLoadTimeoutW3C

pageLoadTimeoutW3C(ms): Promise<void>

Set the page load timeout value that was sent in via the W3C protocol

Parameters

Name Type Description
ms number the timeout in ms

Returns

Promise<void>

Inherited from

Driver.pageLoadTimeoutW3C

Defined in

packages/types/lib/driver.ts:99


parseTimeoutArgument

parseTimeoutArgument(ms): number

Get a timeout value from a number or a string

Parameters

Name Type Description
ms string | number the timeout value as a number or a string

Returns

number

The timeout as a number in ms

Inherited from

Driver.parseTimeoutArgument

Defined in

packages/types/lib/driver.ts:138


performActions

Optional performActions(actions): Promise<void>

Perform touch or keyboard actions

See

https://w3c.github.io/webdriver/#perform-actions

Parameters

Name Type Description
actions ActionSequence[] the action sequence

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1160


postAcceptAlert

Optional postAcceptAlert(): Promise<void>

Accept a simple dialog/alert

See

https://w3c.github.io/webdriver/#accept-alert

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1178


postDismissAlert

Optional postDismissAlert(): Promise<void>

Dismiss a simple dialog/alert

See

https://w3c.github.io/webdriver/#dismiss-alert

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1172


powerAC

Optional powerAC(state): Promise<void>

Set the AC-connected power state of the device

Deprecated

Parameters

Name Type Description
state string whether the device is connected to power or not

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1341


powerCapacity

Optional powerCapacity(percent): Promise<void>

Set the simulated power capacity of the device

Deprecated

Parameters

Name Type Description
percent number how full the battery should become

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1332


pressKeyCode

Optional pressKeyCode(keycode, metastate?, flags?): Promise<void>

Press a device hardware key by its code for the default duration

Deprecated

Parameters

Name Type Description
keycode number the keycode
metastate? number the code denoting the simultaneous pressing of any meta keys (shift etc)
flags? number the code denoting the combination of extra flags

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1262


proxyActive

proxyActive(sessionId?): boolean

Parameters

Name Type
sessionId? string

Returns

boolean

Inherited from

Driver.proxyActive

Defined in

packages/types/lib/driver.ts:638


proxyCommand

Optional proxyCommand<TReq, TRes>(url, method, body?): Promise<TRes>

Proxy a command to a connected WebDriver server

Type parameters

Name Type Description
TReq any the type of the incoming body
TRes unknown the type of the return value

Parameters

Name Type Description
url string the incoming URL
method HTTPMethod the incoming HTTP method
body? TReq the incoming HTTP body

Returns

Promise<TRes>

The return value of the proxied command

Defined in

packages/types/lib/driver.ts:1986


proxyRouteIsAvoided

proxyRouteIsAvoided(sessionId, method, url, body?): boolean

Parameters

Name Type
sessionId string
method string
url string
body? any

Returns

boolean

Inherited from

Driver.proxyRouteIsAvoided

Defined in

packages/types/lib/driver.ts:641


pullFile

Optional pullFile(path): Promise<string>

Retrieve the data from a file on the device at a given path

Parameters

Name Type Description
path string the remote path on the device to pull file data from

Returns

Promise<string>

The base64-encoded file data

Defined in

packages/types/lib/driver.ts:1496


pullFolder

Optional pullFolder(path): Promise<string>

Retrieve the data from a folder on the device at a given path

Parameters

Name Type Description
path string the remote path of a directory on the device

Returns

Promise<string>

The base64-encoded zip file of the directory contents

Defined in

packages/types/lib/driver.ts:1505


pushFile

Optional pushFile(path, data): Promise<void>

Push data to a file at a remote path on the device

Parameters

Name Type Description
path string the remote path on the device to create the file at
data string the base64-encoded data which will be decoded and written to path

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1487


queryAppState

Optional queryAppState(appId): Promise<0 | 2 | 1 | 3 | 4>

Get the running state of an app

Parameters

Name Type Description
appId string the package or bundle ID of the application

Returns

Promise<0 | 2 | 1 | 3 | 4>

A number representing the state. 0 means not installed, 1 means not running, 2 means running in background but suspended, 3 means running in the background, and 4 means running in the foreground

Defined in

packages/types/lib/driver.ts:1455


refresh

Optional refresh(): Promise<void>

Refresh the page

See

https://w3c.github.io/webdriver/#refresh

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:810


releaseActions

Optional releaseActions(): Promise<void>

Release all keys or buttons that are currently pressed

See

https://w3c.github.io/webdriver/#release-actions

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1166


removeAllAuthCredentials

Optional removeAllAuthCredentials(): Promise<void>

Remove all auth credentials

See

https://www.w3.org/TR/webauthn-2/#sctn-automation-remove-all-credentials

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1956


removeApp

Optional removeApp(appId, options?): Promise<boolean>

Remove / uninstall an app

Parameters

Name Type Description
appId string the package or bundle ID of the application
options? unknown driver-specific launch options

Returns

Promise<boolean>

true if successful

Defined in

packages/types/lib/driver.ts:1429


removeAuthCredential

Optional removeAuthCredential(credentialId, authenticatorId): Promise<void>

Remove a specific auth credential

Parameters

Name Type Description
credentialId string the credential ID
authenticatorId string the authenticator ID

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1964


removeVirtualAuthenticator

Optional removeVirtualAuthenticator(authenticatorId): Promise<void>

Remove a virtual authenticator

See

https://www.w3.org/TR/webauthn-2/#sctn-automation-remove-virtual-authenticator

Parameters

Name Type Description
authenticatorId string the ID returned in the call to add the authenticator

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1920


replaceValue

Optional replaceValue(value, elementId): Promise<void>

Set the value of a text field but ensure the current value is replace and not appended

Deprecated

Parameters

Name Type Description
value string the text to set
elementId string the element to set it in

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1616


reset

reset(): Promise<void>

Reset the current session (run the delete session and create session subroutines)

Deprecated

Use explicit session management commands instead

Returns

Promise<void>

Inherited from

Driver.reset

Defined in

packages/types/lib/driver.ts:714


scriptTimeoutMJSONWP

scriptTimeoutMJSONWP(ms): Promise<void>

Set the script timeout value that was sent in via the JSONWP

Deprecated

Parameters

Name Type Description
ms number the timeout in ms

Returns

Promise<void>

Inherited from

Driver.scriptTimeoutMJSONWP

Defined in

packages/types/lib/driver.ts:122


scriptTimeoutW3C

scriptTimeoutW3C(ms): Promise<void>

Set the script timeout value that was sent in via the W3C protocol

Parameters

Name Type Description
ms number the timeout in ms

Returns

Promise<void>

Inherited from

Driver.scriptTimeoutW3C

Defined in

packages/types/lib/driver.ts:114


sendSMS

Optional sendSMS(phoneNumber, message): Promise<void>

Simulate sending an SMS message from a certain phone number to the device

Deprecated

Parameters

Name Type Description
phoneNumber string the number to pretend the message is from
message string the SMS text

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1293


sessionExists

sessionExists(sessionId?): boolean

Parameters

Name Type
sessionId? string

Returns

boolean

Inherited from

Driver.sessionExists

Defined in

packages/types/lib/driver.ts:632


setAlertText

Optional setAlertText(text): Promise<void>

Set the text field of an alert prompt

See

https://w3c.github.io/webdriver/#send-alert-text

Parameters

Name Type Description
text string the text to send to the prompt

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1194


setContext

Optional setContext(name, ...args): Promise<void>

Switch to a context by name

See

https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#webviews-and-other-contexts

Parameters

Name Type Description
name string the context name
...args any[] -

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1819


setCookie

Optional setCookie(cookie): Promise<void>

Add a cookie to the browsing context

See

https://w3c.github.io/webdriver/#add-cookie

Parameters

Name Type Description
cookie Cookie the cookie data including properties like name, value, path, domain, secure, httpOnly, expiry, and samesite

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1138


setFrame

Optional setFrame(id): Promise<void>

Switch the current browsing context to a frame

See

https://w3c.github.io/webdriver/#switch-to-frame

Parameters

Name Type Description
id null | string | number the frame id, index, or null (indicating the top-level context)

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:879


setGeoLocation

Optional setGeoLocation(location): Promise<Location>

Set the virtual geographical location of a device

Parameters

Name Type Description
location Partial<Location> the location including latitude and longitude

Returns

Promise<Location>

The complete location

Defined in

packages/types/lib/driver.ts:1801


setImplicitWait

setImplicitWait(ms): void

A helper method (not a command) used to set the implicit wait value

Parameters

Name Type Description
ms number the implicit wait in ms

Returns

void

Inherited from

Driver.setImplicitWait

Defined in

packages/types/lib/driver.ts:60


setNetworkConnection

Optional setNetworkConnection(type): Promise<number>

Set the network connection of the device

See

https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-modes

Parameters

Name Type Description
type number the bitmask representing network state

Returns

Promise<number>

A number which is a bitmask representing categories like Data, Wifi, and Airplane mode status

Defined in

packages/types/lib/driver.ts:1858


setNewCommandTimeout

setNewCommandTimeout(ms): void

Set the new command timeout

Parameters

Name Type Description
ms number the timeout in ms

Returns

void

Inherited from

Driver.setNewCommandTimeout

Defined in

packages/types/lib/driver.ts:43


setOrientation

Optional setOrientation(orientation): Promise<void>

Set the device orientation

Parameters

Name Type Description
orientation string the orientation string

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1687


setRotation

Optional setRotation(x, y, z): Promise<void>

Set the device rotation state

See

https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md#device-rotation

Parameters

Name Type Description
x number the degree to which the device is rotated around the x axis (0 <= x <= 360)
y number the degree to which the device is rotated around the y axis (0 <= y <= 360)
z number the degree to which the device is rotated around the z axis (0 <= z <= 360)

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1876


setUrl

Optional setUrl(url): Promise<void>

Navigate to a given url

See

https://w3c.github.io/webdriver/#navigate-to

Parameters

Name Type Description
url string the url

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:784


setUserAuthVerified

Optional setUserAuthVerified(isUserVerified, authenticatorId): Promise<void>

Set the isUserVerified property of an authenticator

See

https://www.w3.org/TR/webauthn-2/#sctn-automation-set-user-verified

Parameters

Name Type Description
isUserVerified boolean the value of the isUserVerified property
authenticatorId string the authenticator id

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1973


setValue

Optional setValue(text, elementId): Promise<void>

Send keystrokes to an element (or otherwise set its value)

See

https://w3c.github.io/webdriver/#element-send-keys

Parameters

Name Type Description
text string the text to send to the element
elementId string the id of the element

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1086


setWindow

Optional setWindow(handle): Promise<void>

Switch to a specified window

See

https://w3c.github.io/webdriver/#switch-to-window

Parameters

Name Type Description
handle string the window handle of the window to make active

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:853


setWindowRect

Optional setWindowRect(x, y, width, height): Promise<Rect>

Set the current window's size and position

See

https://w3c.github.io/webdriver/#set-window-rect

Parameters

Name Type Description
x number the screen coordinate for the new left edge of the window
y number the screen coordinate for the new top edge of the window
width number the width in pixels to resize the window to
height number the height in pixels to resize the window to

Returns

Promise<Rect>

The actual Rect of the window after running the command

Defined in

packages/types/lib/driver.ts:906


startActivity

Optional startActivity(appPackage, appActivity, appWaitPackage?, appWaitActivity?, intentAction?, intentCategory?, intentFlags?, optionalIntentArguments?, dontStopAppOnReset?): Promise<void>

Start an Android activity within an app

Deprecated

Parameters

Name Type Description
appPackage string the app package id
appActivity string the activity name
appWaitPackage? string the package id to wait for if different from the app package
appWaitActivity? string the activity name to wait for being active if different from appActivity
intentAction? string the action for the intent to use to start the activity
intentCategory? string the category for the intent
intentFlags? string -
optionalIntentArguments? string additional arguments to be passed to launching the intent
dontStopAppOnReset? boolean set to true to not stop the current app before launching the activity

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1565


startNewCommandTimeout

startNewCommandTimeout(): Promise<void>

Start the timer for the New Command Timeout, which when it runs out, will stop the current session

Returns

Promise<void>

Inherited from

Driver.startNewCommandTimeout

Defined in

packages/types/lib/driver.ts:706


startUnexpectedShutdown

startUnexpectedShutdown(err?): Promise<void>

Signify to any owning processes that this driver encountered an error which should cause the session to terminate immediately (for example an upstream service failed)

Parameters

Name Type Description
err? Error the Error object which is causing the shutdown

Returns

Promise<void>

Inherited from

Driver.startUnexpectedShutdown

Defined in

packages/types/lib/driver.ts:700


switchToParentFrame

Optional switchToParentFrame(): Promise<void>

Set the current browsing context to the parent of the current context

See

https://w3c.github.io/webdriver/#switch-to-parent-frame

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:885


terminateApp

Optional terminateApp(appId, options?): Promise<boolean>

Quit / terminate / stop a running application

Parameters

Name Type Description
appId string the package or bundle ID of the application
options? unknown driver-specific launch options

Returns

Promise<boolean>

Defined in

packages/types/lib/driver.ts:1437


timeouts

timeouts(type, ms, script?, pageLoad?, implicit?): Promise<void>

Set the various timeouts associated with a session

See

https://w3c.github.io/webdriver/#set-timeouts

Parameters

Name Type Description
type string used only for the old (JSONWP) command, the type of the timeout
ms string | number used only for the old (JSONWP) command, the ms for the timeout
script? number the number in ms for the script timeout, used for the W3C command
pageLoad? number the number in ms for the pageLoad timeout, used for the W3C command
implicit? string | number the number in ms for the implicit wait timeout, used for the W3C command

Returns

Promise<void>

Inherited from

Driver.timeouts

Defined in

packages/types/lib/driver.ts:30


title

Optional title(): Promise<string>

Get the current page title

See

https://w3c.github.io/webdriver/#get-title

Example

await driver.getTitle()
driver.title
driver.getTitle();

Returns

Promise<string>

The title

Defined in

packages/types/lib/driver.ts:829


toggleData

Optional toggleData(): Promise<void>

Toggle cell network data

Deprecated

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1521


toggleFlightMode

Optional toggleFlightMode(): Promise<void>

Toggle airplane/flight mode for the device

Deprecated

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1513


toggleLocationServices

Optional toggleLocationServices(): Promise<void>

Toggle location services for the device

Deprecated

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1537


toggleWiFi

Optional toggleWiFi(): Promise<void>

Toggle WiFi radio status

Deprecated

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1529


touchDown

Optional touchDown(element, x, y): Promise<void>

Perform a touch down event at the location specified

Deprecated

Use the Actions API instead

Parameters

Name Type Description
element string -
x number the x coordinate
y number the y coordinate

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1735


touchLongClick

Optional touchLongClick(element, x, y, duration): Promise<void>

Perform a long touch down event at the location specified

Deprecated

Use the Actions API instead

Parameters

Name Type
element string
x number
y number
duration number

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1764


touchMove

Optional touchMove(element, x, y): Promise<void>

Perform a touch move event at the location specified

Deprecated

Use the Actions API instead

Parameters

Name Type Description
element string -
x number the x coordinate
y number the y coordinate

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1755


touchUp

Optional touchUp(element, x, y): Promise<void>

Perform a touch up event at the location specified

Deprecated

Use the Actions API instead

Parameters

Name Type Description
element string -
x number the x coordinate
y number the y coordinate

Returns

Promise<void>

Defined in

packages/types/lib/driver.ts:1745


validateDesiredCaps

validateDesiredCaps(caps): boolean

Validate the capabilities used to start a session

Parameters

Name Type Description
caps DriverCaps<C> the capabilities

Returns

boolean

Whether or not the capabilities are valid

Inherited from

Driver.validateDesiredCaps

Defined in

packages/types/lib/driver.ts:740


validateLocatorStrategy

validateLocatorStrategy(strategy, webContext?): void

Parameters

Name Type
strategy string
webContext? boolean

Returns

void

Inherited from

Driver.validateLocatorStrategy

Defined in

packages/types/lib/driver.ts:637