Skip to content

Class: BaseDriver<C>

@appium/base-driver.BaseDriver

This ensures that all of the mixins correctly implement the interface described in Driver.

Implements

Type parameters

Name Type
C {}

Hierarchy

BaseDriver

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new BaseDriver<C>(...arguments_)

Type parameters

Name Type
C extends Readonly<Record<string, Constraint>> = {}

Parameters

Name Type
...arguments_ any[]

Inherited from

createBaseDriverClass(BaseDriverCore).constructor

Defined in

node_modules/type-fest/source/basic.d.ts:13

Properties

_eventHistory

_eventHistory: EventHistory

Inherited from

createBaseDriverClass(BaseDriverCore)._eventHistory

Defined in

packages/base-driver/lib/basedriver/core.js:87


_log

_log: AppiumLogger

Inherited from

createBaseDriverClass(BaseDriverCore)._log

Defined in

packages/base-driver/lib/basedriver/core.js:96


allowInsecure

allowInsecure: string[] = []

Inherited from

createBaseDriverClass(BaseDriverCore).allowInsecure

Defined in

packages/base-driver/lib/basedriver/core.js:65


basePath

basePath: string = DEFAULT_BASE_PATH

basePath is used for several purposes, for example in setting up proxying to other drivers, since we need to know what the base path of any incoming request might look like. We set it to the default initially but it is automatically updated during any actual program execution by the routeConfiguringFunction, which is necessarily run as the entrypoint for any Appium server

Inherited from

createBaseDriverClass(BaseDriverCore).basePath

Defined in

packages/base-driver/lib/basedriver/core.js:60


caps

caps: Partial<ConstraintsToCaps<any> & void>

Inherited from

createBaseDriverClass(BaseDriverCore).caps

Defined in

packages/base-driver/lib/basedriver/driver.js:36


cliArgs

cliArgs: StringRecord & ServerArgs

Inherited from

createBaseDriverClass(BaseDriverCore).cliArgs

Defined in

packages/base-driver/lib/basedriver/driver.js:31


commandsQueueGuard

Protected commandsQueueGuard: AsyncLock

Inherited from

createBaseDriverClass(BaseDriverCore).commandsQueueGuard

Defined in

packages/base-driver/lib/basedriver/core.js:111


denyInsecure

denyInsecure: string[] = []

Inherited from

createBaseDriverClass(BaseDriverCore).denyInsecure

Defined in

packages/base-driver/lib/basedriver/core.js:68


desiredCapConstraints

desiredCapConstraints: any

Inherited from

createBaseDriverClass(BaseDriverCore).desiredCapConstraints

Defined in

packages/base-driver/lib/basedriver/driver.js:46


eventEmitter

eventEmitter: EventEmitter

Inherited from

createBaseDriverClass(BaseDriverCore).eventEmitter

Defined in

packages/base-driver/lib/basedriver/core.js:91


helpers

helpers: DriverHelpers<any> = helpers

Inherited from

createBaseDriverClass(BaseDriverCore).helpers

Defined in

packages/base-driver/lib/basedriver/core.js:50


implicitWaitMs

implicitWaitMs: number = 0

Inherited from

createBaseDriverClass(BaseDriverCore).implicitWaitMs

Defined in

packages/base-driver/lib/basedriver/core.js:72


initialOpts

initialOpts: ServerArgs

Inherited from

createBaseDriverClass(BaseDriverCore).initialOpts

Defined in

packages/base-driver/lib/basedriver/core.js:48


locatorStrategies

locatorStrategies: string[] = []

Inherited from

createBaseDriverClass(BaseDriverCore).locatorStrategies

Defined in

packages/base-driver/lib/basedriver/core.js:75


managedDrivers

managedDrivers: Driver<typeof BASE_DESIRED_CAP_CONSTRAINTS, StringRecord, any>[] = []

Inherited from

createBaseDriverClass(BaseDriverCore).managedDrivers

Defined in

packages/base-driver/lib/basedriver/core.js:81


newCommandTimeoutMs

newCommandTimeoutMs: number

Inherited from

createBaseDriverClass(BaseDriverCore).newCommandTimeoutMs

Defined in

packages/base-driver/lib/basedriver/driver.js:337


noCommandTimer

noCommandTimer: null | Timeout

Inherited from

createBaseDriverClass(BaseDriverCore).noCommandTimer

Defined in

packages/base-driver/lib/basedriver/driver.js:189


opts

opts: ServerArgs & ExtraDriverOpts & Partial<ConstraintsToCaps<any>> & Partial<ConstraintsToCaps<typeof BASE_DESIRED_CAP_CONSTRAINTS>>

Inherited from

createBaseDriverClass(BaseDriverCore).opts

Defined in

packages/base-driver/lib/basedriver/driver.js:51


originalCaps

originalCaps: W3CCapabilities<any, void>

Inherited from

createBaseDriverClass(BaseDriverCore).originalCaps

Defined in

packages/base-driver/lib/basedriver/driver.js:41


protocol

protocol: undefined | string

Inherited from

createBaseDriverClass(BaseDriverCore).protocol

Defined in

packages/base-driver/lib/basedriver/driver.js:100


relaxedSecurityEnabled

relaxedSecurityEnabled: boolean = false

Inherited from

createBaseDriverClass(BaseDriverCore).relaxedSecurityEnabled

Defined in

packages/base-driver/lib/basedriver/core.js:62


resetOnUnexpectedShutdown

resetOnUnexpectedShutdown: undefined | () => void

Inherited from

createBaseDriverClass(BaseDriverCore).resetOnUnexpectedShutdown

Defined in

packages/base-driver/lib/basedriver/driver.js:237


server

server: undefined | AppiumServer

Inherited from

createBaseDriverClass(BaseDriverCore).server

Defined in

packages/base-driver/lib/basedriver/driver.js:211


serverHost

serverHost: undefined | string

Inherited from

createBaseDriverClass(BaseDriverCore).serverHost

Defined in

packages/base-driver/lib/basedriver/driver.js:212


serverPath

serverPath: undefined | string

Inherited from

createBaseDriverClass(BaseDriverCore).serverPath

Defined in

packages/base-driver/lib/basedriver/driver.js:214


serverPort

serverPort: undefined | number

Inherited from

createBaseDriverClass(BaseDriverCore).serverPort

Defined in

packages/base-driver/lib/basedriver/driver.js:213


sessionId

sessionId: null | string

Inherited from

createBaseDriverClass(BaseDriverCore).sessionId

Defined in

packages/base-driver/lib/basedriver/driver.js:307

packages/base-driver/lib/basedriver/driver.js:363


settings

settings: DeviceSettings<any>

settings should be instantiated by drivers which extend BaseDriver, but we set it to an empty DeviceSettings instance here to make sure that the default settings are applied even if an extending driver doesn't utilize the settings functionality itself

Inherited from

createBaseDriverClass(BaseDriverCore).settings

Defined in

packages/base-driver/lib/basedriver/core.js:119


shouldValidateCaps

shouldValidateCaps: boolean

Inherited from

createBaseDriverClass(BaseDriverCore).shouldValidateCaps

Defined in

packages/base-driver/lib/basedriver/core.js:106


shutdownUnexpectedly

shutdownUnexpectedly: boolean

Inherited from

createBaseDriverClass(BaseDriverCore).shutdownUnexpectedly

Defined in

packages/base-driver/lib/basedriver/driver.js:172

packages/base-driver/lib/basedriver/driver.js:178


supportedLogTypes

supportedLogTypes: Readonly<LogDefRecord<any>>

Definition of the available log types

Inherited from

createBaseDriverClass(BaseDriverCore).supportedLogTypes

Defined in

packages/types/build/lib/driver.d.ts:261


updateSettings

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

Type declaration

▸ (settings): Promise<void>

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

Parameters
Name Type Description
settings StringRecord 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

createBaseDriverClass(BaseDriverCore).updateSettings

Defined in

packages/types/build/lib/driver.d.ts:303


webLocatorStrategies

webLocatorStrategies: string[] = []

Inherited from

createBaseDriverClass(BaseDriverCore).webLocatorStrategies

Defined in

packages/base-driver/lib/basedriver/core.js:78


baseVersion

Static baseVersion: string

Inherited from

createBaseDriverClass(BaseDriverCore).baseVersion

Defined in

packages/types/build/lib/driver.d.ts:1831


executeMethodMap

Static Optional executeMethodMap: Readonly<Record<string, Readonly<ExecuteMethodDef<any>>>>

Inherited from

createBaseDriverClass(BaseDriverCore).executeMethodMap

Defined in

packages/types/build/lib/driver.d.ts:1834


newMethodMap

Static Optional newMethodMap: Readonly<Record<string, { DELETE?: MethodDef<any> ; GET?: MethodDef<any> ; POST?: MethodDef<any> }>>

Inherited from

createBaseDriverClass(BaseDriverCore).newMethodMap

Defined in

packages/types/build/lib/driver.d.ts:1833


updateServer

Static Optional updateServer: UpdateServerCallback

Inherited from

createBaseDriverClass(BaseDriverCore).updateServer

Defined in

packages/types/build/lib/driver.d.ts:1832

Accessors

_desiredCapConstraints

Protected get _desiredCapConstraints(): Readonly<typeof BASE_DESIRED_CAP_CONSTRAINTS & C>

Contains the base constraints plus whatever the subclass wants to add.

Subclasses shouldn't need to use this. If you need to use this, please create an issue:

See

https://github.com/appium/appium/issues/new

Returns

Readonly<typeof BASE_DESIRED_CAP_CONSTRAINTS & C>

Inherited from

createBaseDriverClass(BaseDriverCore)._desiredCapConstraints

Defined in

packages/base-driver/lib/basedriver/driver.js:81


driverData

get driverData(): Record<string, unknown>

This property is used by AppiumDriver to store the data of the specific driver sessions. This data can be later used to adjust properties for driver instances running in parallel. Override it in inherited driver classes if necessary.

Returns

Record<string, unknown>

Driver properties mapping

Inherited from

createBaseDriverClass(BaseDriverCore).driverData

Defined in

packages/base-driver/lib/basedriver/core.js:169


eventHistory

get eventHistory(): EventHistory

Returns

EventHistory

Inherited from

createBaseDriverClass(BaseDriverCore).eventHistory

Defined in

packages/base-driver/lib/basedriver/core.js:192


isCommandsQueueEnabled

get isCommandsQueueEnabled(): boolean

This property controls the way the executeCommand method handles new driver commands received from the client. Override it for inherited classes only in special cases.

Returns

boolean

If the returned value is true (default) then all the commands received by the particular driver instance are going to be put into the queue, so each following command will not be executed until the previous command execution is completed. False value disables that queue, so each driver command is executed independently and does not wait for anything.

Inherited from

createBaseDriverClass(BaseDriverCore).isCommandsQueueEnabled

Defined in

packages/base-driver/lib/basedriver/core.js:184


log

get log(): AppiumLogger

Returns

AppiumLogger

Inherited from

createBaseDriverClass(BaseDriverCore).log

Defined in

packages/base-driver/lib/basedriver/core.js:144

Methods

addManagedDriver

addManagedDriver(driver): void

Parameters

Name Type
driver Driver<typeof BASE_DESIRED_CAP_CONSTRAINTS, StringRecord, any>

Returns

void

Inherited from

createBaseDriverClass(BaseDriverCore).addManagedDriver

Defined in

packages/base-driver/lib/basedriver/core.js:402


assertFeatureEnabled

assertFeatureEnabled(name): void

Assert that a given feature is enabled and throw a helpful error if it's not

Parameters

Name Type Description
name string name of feature/command

Returns

void

Inherited from

createBaseDriverClass(BaseDriverCore).assertFeatureEnabled

Defined in

packages/base-driver/lib/basedriver/core.js:306


assignServer

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

Parameters

Name Type
server AppiumServer
host string
port number
path string

Returns

void

Inherited from

createBaseDriverClass(BaseDriverCore).assignServer

Defined in

packages/base-driver/lib/basedriver/driver.js:210


canProxy

canProxy(sessionId?): boolean

Parameters

Name Type
sessionId? string

Returns

boolean

Inherited from

createBaseDriverClass(BaseDriverCore).canProxy

Defined in

packages/base-driver/lib/basedriver/core.js:361


clearNewCommandTimeout

clearNewCommandTimeout(): Promise<void>

Returns

Promise<void>

Inherited from

createBaseDriverClass(BaseDriverCore).clearNewCommandTimeout

Defined in

packages/base-driver/lib/basedriver/core.js:410


createSession

createSession(w3cCapabilities1, w3cCapabilities2?, w3cCapabilities?, driverData?): Promise<[string, Partial<ConstraintsToCaps<any> & void>]>

Historically the first two arguments were reserved for JSONWP capabilities. Appium 2 has dropped the support of these, so now we only accept capability objects in W3C format and thus allow any of the three arguments to represent the latter.

Parameters

Name Type
w3cCapabilities1 W3CCapabilities<any, void>
w3cCapabilities2? W3CCapabilities<any, void>
w3cCapabilities? W3CCapabilities<any, void>
driverData? DriverData[]

Returns

Promise<[string, Partial<ConstraintsToCaps<any> & void>]>

Inherited from

createBaseDriverClass(BaseDriverCore).createSession

Defined in

packages/base-driver/lib/basedriver/driver.js:266


deleteSession

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

Parameters

Name Type
sessionId? string
driverData? DriverData[]

Returns

Promise<void>

Inherited from

createBaseDriverClass(BaseDriverCore).deleteSession

Defined in

packages/base-driver/lib/basedriver/driver.js:353


driverForSession

driverForSession(sessionId): null | Core<any>

method required by MJSONWP in order to determine if the command should be proxied directly to the driver

Parameters

Name Type
sessionId string

Returns

null | Core<any>

Inherited from

createBaseDriverClass(BaseDriverCore).driverForSession

Defined in

packages/base-driver/lib/basedriver/core.js:241


ensureFeatureEnabled

ensureFeatureEnabled(name): void

Assert that a given feature is enabled and throw a helpful error if it's not

Deprecated

Parameters

Name Type Description
name string name of feature/command

Returns

void

Inherited from

createBaseDriverClass(BaseDriverCore).ensureFeatureEnabled

Defined in

packages/base-driver/lib/basedriver/core.js:296


executeCommand

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

Parameters

Name Type
cmd string
...args any[]

Returns

Promise<any>

Inherited from

createBaseDriverClass(BaseDriverCore).executeCommand

Defined in

packages/base-driver/lib/basedriver/driver.js:94


executeMethod

executeMethod(script, args): Promise<any>

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.

Parameters

Name Type Description
script string the name of the Execute Method
args [] | [StringRecord] a singleton array containing an arguments object

Returns

Promise<any>

The result of calling the Execute Method

Inherited from

createBaseDriverClass(BaseDriverCore).executeMethod

Defined in

packages/types/build/lib/driver.d.ts:149


findElOrEls

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

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

Type parameters

Name Type
Mult extends boolean

Parameters

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

Returns

Promise<Mult extends true ? Element[] : Element>

A single element or list of elements

Inherited from

createBaseDriverClass(BaseDriverCore).findElOrEls

Defined in

packages/types/build/lib/driver.d.ts:236


findElOrElsWithProcessing

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

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

Type parameters

Name Type
Mult extends boolean

Parameters

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

Returns

Promise<Mult extends true ? Element[] : Element>

A single element or list of elements

Inherited from

createBaseDriverClass(BaseDriverCore).findElOrElsWithProcessing

Defined in

packages/types/build/lib/driver.d.ts:248


findElement

findElement(strategy, selector): Promise<Element>

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>

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

Inherited from

createBaseDriverClass(BaseDriverCore).findElement

Defined in

packages/types/build/lib/driver.d.ts:170


findElementFromElement

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

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>

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

Inherited from

createBaseDriverClass(BaseDriverCore).findElementFromElement

Defined in

packages/types/build/lib/driver.d.ts:193


findElementFromShadowRoot

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

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>

The element inside the shadow root matching the selector

Inherited from

createBaseDriverClass(BaseDriverCore).findElementFromShadowRoot

Defined in

packages/types/build/lib/driver.d.ts:215


findElements

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

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[]>

A possibly-empty list of element objects

Inherited from

createBaseDriverClass(BaseDriverCore).findElements

Defined in

packages/types/build/lib/driver.d.ts:180


findElementsFromElement

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

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[]>

A possibly-empty list of element objects

Inherited from

createBaseDriverClass(BaseDriverCore).findElementsFromElement

Defined in

packages/types/build/lib/driver.d.ts:205


findElementsFromShadowRoot

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

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[]>

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

Inherited from

createBaseDriverClass(BaseDriverCore).findElementsFromShadowRoot

Defined in

packages/types/build/lib/driver.d.ts:225


getLog

getLog(logType): Promise<unknown[]>

Get the log for a given log type.

Parameters

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

Returns

Promise<unknown[]>

Inherited from

createBaseDriverClass(BaseDriverCore).getLog

Defined in

packages/types/build/lib/driver.d.ts:271


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

createBaseDriverClass(BaseDriverCore).getLogEvents

Defined in

packages/types/build/lib/driver.d.ts:123


getLogTypes

getLogTypes(): Promise<string[]>

Get available log types as a list of strings

Returns

Promise<string[]>

Inherited from

createBaseDriverClass(BaseDriverCore).getLogTypes

Defined in

packages/types/build/lib/driver.d.ts:265


getManagedDrivers

getManagedDrivers(): Driver<typeof BASE_DESIRED_CAP_CONSTRAINTS, StringRecord, any>[]

Returns

Driver<typeof BASE_DESIRED_CAP_CONSTRAINTS, StringRecord, any>[]

Inherited from

createBaseDriverClass(BaseDriverCore).getManagedDrivers

Defined in

packages/base-driver/lib/basedriver/core.js:406


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

createBaseDriverClass(BaseDriverCore).getPageSource

Defined in

packages/types/build/lib/driver.d.ts:255


getProxyAvoidList

getProxyAvoidList(sessionId): RouteMatcher[]

Parameters

Name Type
sessionId string

Returns

RouteMatcher[]

Inherited from

createBaseDriverClass(BaseDriverCore).getProxyAvoidList

Defined in

packages/base-driver/lib/basedriver/core.js:352


getSession

getSession(): Promise<SingularSessionData<typeof BASE_DESIRED_CAP_CONSTRAINTS, void>>

Get the data for the current session

Returns

Promise<SingularSessionData<typeof BASE_DESIRED_CAP_CONSTRAINTS, void>>

A session data object

Inherited from

createBaseDriverClass(BaseDriverCore).getSession

Defined in

packages/types/build/lib/driver.d.ts:137


getSessions

getSessions(): Promise<MultiSessionData<typeof BASE_DESIRED_CAP_CONSTRAINTS, void>[]>

Get data for all sessions running on an Appium server

Returns

Promise<MultiSessionData<typeof BASE_DESIRED_CAP_CONSTRAINTS, void>[]>

A list of session data objects

Inherited from

createBaseDriverClass(BaseDriverCore).getSessions

Defined in

packages/types/build/lib/driver.d.ts:131


getSettings

getSettings(): Promise<StringRecord>

Get the current settings for the session

Returns

Promise<StringRecord>

The settings object

Inherited from

createBaseDriverClass(BaseDriverCore).getSettings

Defined in

packages/types/build/lib/driver.d.ts:309


getStatus

getStatus(): Promise<{}>

Returns

Promise<{}>

Inherited from

createBaseDriverClass(BaseDriverCore).getStatus

Defined in

packages/base-driver/lib/basedriver/core.js:220


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

createBaseDriverClass(BaseDriverCore).getTimeouts

Defined in

packages/types/build/lib/driver.d.ts:53


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

createBaseDriverClass(BaseDriverCore).implicitWait

Defined in

packages/types/build/lib/driver.d.ts:32


implicitWaitForCondition

implicitWaitForCondition(condition): Promise<unknown>

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

Parameters

Name Type Description
condition () => Promise<any> the behaviour to retry until it returns truthy

Returns

Promise<unknown>

The return value of the condition

Inherited from

createBaseDriverClass(BaseDriverCore).implicitWaitForCondition

Defined in

packages/types/build/lib/driver.d.ts:46


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

createBaseDriverClass(BaseDriverCore).implicitWaitMJSONWP

Defined in

packages/types/build/lib/driver.d.ts:66


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

createBaseDriverClass(BaseDriverCore).implicitWaitW3C

Defined in

packages/types/build/lib/driver.d.ts:59


isFeatureEnabled

isFeatureEnabled(name): boolean

Check whether a given feature is enabled via its name

Parameters

Name Type Description
name string name of feature/command

Returns

boolean

Inherited from

createBaseDriverClass(BaseDriverCore).isFeatureEnabled

Defined in

packages/base-driver/lib/basedriver/core.js:268


isMjsonwpProtocol

isMjsonwpProtocol(): boolean

Returns

boolean

Inherited from

createBaseDriverClass(BaseDriverCore).isMjsonwpProtocol

Defined in

packages/base-driver/lib/basedriver/core.js:245


isW3CProtocol

isW3CProtocol(): boolean

Returns

boolean

Inherited from

createBaseDriverClass(BaseDriverCore).isW3CProtocol

Defined in

packages/base-driver/lib/basedriver/core.js:249


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

createBaseDriverClass(BaseDriverCore).logCustomEvent

Defined in

packages/types/build/lib/driver.d.ts:115


logEvent

logEvent(eventName): void

API method for driver developers to log timings for important events

Parameters

Name Type
eventName string

Returns

void

Inherited from

createBaseDriverClass(BaseDriverCore).logEvent

Defined in

packages/base-driver/lib/basedriver/core.js:200


logExtraCaps

logExtraCaps(caps): void

Parameters

Name Type
caps Partial<ConstraintsToCaps<any> & void>

Returns

void

Inherited from

createBaseDriverClass(BaseDriverCore).logExtraCaps

Defined in

packages/base-driver/lib/basedriver/driver.js:371


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

createBaseDriverClass(BaseDriverCore).newCommandTimeout

Defined in

packages/types/build/lib/driver.d.ts:98


onUnexpectedShutdown

onUnexpectedShutdown(handler): void

Set a callback handler if needed to execute a custom piece of code when the driver is shut down unexpectedly. Multiple calls to this method will cause the handler to be executed mutiple times

Parameters

Name Type Description
handler (...args: any[]) => void The code to be executed on unexpected shutdown. The function may accept one argument, which is the actual error instance, which caused the driver to shut down.

Returns

void

Inherited from

createBaseDriverClass(BaseDriverCore).onUnexpectedShutdown

Defined in

packages/base-driver/lib/basedriver/core.js:157


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

createBaseDriverClass(BaseDriverCore).pageLoadTimeoutMJSONWP

Defined in

packages/types/build/lib/driver.d.ts:79


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

createBaseDriverClass(BaseDriverCore).pageLoadTimeoutW3C

Defined in

packages/types/build/lib/driver.d.ts:72


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

createBaseDriverClass(BaseDriverCore).parseTimeoutArgument

Defined in

packages/types/build/lib/driver.d.ts:106


proxyActive

proxyActive(sessionId?): boolean

Parameters

Name Type
sessionId? string

Returns

boolean

Inherited from

createBaseDriverClass(BaseDriverCore).proxyActive

Defined in

packages/base-driver/lib/basedriver/core.js:343


proxyRouteIsAvoided

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

Whether a given command route (expressed as method and url) should not be proxied according to this driver

Parameters

Name Type Description
sessionId string the current sessionId (in case the driver runs multiple session ids and requires it). This is not used in this method but should be made available to overridden methods.
method HTTPMethod HTTP method of the route
url string url of the route
body? any webdriver request body

Returns

boolean

  • whether the route should be avoided

Inherited from

createBaseDriverClass(BaseDriverCore).proxyRouteIsAvoided

Defined in

packages/base-driver/lib/basedriver/core.js:378


reset

reset(): Promise<void>

Returns

Promise<void>

Inherited from

createBaseDriverClass(BaseDriverCore).reset

Defined in

packages/base-driver/lib/basedriver/driver.js:221


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

createBaseDriverClass(BaseDriverCore).scriptTimeoutMJSONWP

Defined in

packages/types/build/lib/driver.d.ts:92


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

createBaseDriverClass(BaseDriverCore).scriptTimeoutW3C

Defined in

packages/types/build/lib/driver.d.ts:85


sessionExists

sessionExists(sessionId?): boolean

method required by MJSONWP in order to determine whether it should respond with an invalid session response

Parameters

Name Type
sessionId? string

Returns

boolean

Inherited from

createBaseDriverClass(BaseDriverCore).sessionExists

Defined in

packages/base-driver/lib/basedriver/core.js:230


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

createBaseDriverClass(BaseDriverCore).setImplicitWait

Defined in

packages/types/build/lib/driver.d.ts:38


setNewCommandTimeout

setNewCommandTimeout(ms): void

Set the new command timeout

Parameters

Name Type Description
ms number the timeout in ms

Returns

void

Inherited from

createBaseDriverClass(BaseDriverCore).setNewCommandTimeout

Defined in

packages/types/build/lib/driver.d.ts:24


setProtocolMJSONWP

setProtocolMJSONWP(): void

Returns

void

Inherited from

createBaseDriverClass(BaseDriverCore).setProtocolMJSONWP

Defined in

packages/base-driver/lib/basedriver/core.js:253


setProtocolW3C

setProtocolW3C(): void

Returns

void

Inherited from

createBaseDriverClass(BaseDriverCore).setProtocolW3C

Defined in

packages/base-driver/lib/basedriver/core.js:257


startNewCommandTimeout

startNewCommandTimeout(): Promise<void>

Returns

Promise<void>

Inherited from

createBaseDriverClass(BaseDriverCore).startNewCommandTimeout

Defined in

packages/base-driver/lib/basedriver/driver.js:182


startUnexpectedShutdown

startUnexpectedShutdown(err?): Promise<void>

Parameters

Name Type
err Error | NoSuchDriverError

Returns

Promise<void>

Inherited from

createBaseDriverClass(BaseDriverCore).startUnexpectedShutdown

Defined in

packages/base-driver/lib/basedriver/driver.js:168


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

createBaseDriverClass(BaseDriverCore).timeouts

Defined in

packages/types/build/lib/driver.d.ts:18


validateDesiredCaps

validateDesiredCaps(caps): boolean

Parameters

Name Type
caps Partial<ConstraintsToCaps<any> & void>

Returns

boolean

Inherited from

createBaseDriverClass(BaseDriverCore).validateDesiredCaps

Defined in

packages/base-driver/lib/basedriver/driver.js:388


validateLocatorStrategy

validateLocatorStrategy(strategy, webContext?): void

Parameters

Name Type Default value
strategy string undefined
webContext? boolean false

Returns

void

Inherited from

createBaseDriverClass(BaseDriverCore).validateLocatorStrategy

Defined in

packages/base-driver/lib/basedriver/core.js:323