Skip to content

Class: DriverCore<C, Settings>

@appium/base-driver.DriverCore

Implements

Type parameters

Name Type
C C
Settings StringRecord

Hierarchy

  • DriverCore

BaseDriver

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new DriverCore<C, Settings>(opts?, shouldValidateCaps?)

Type parameters

Name Type
C extends Constraints
Settings extends StringRecord = StringRecord

Parameters

Name Type Default value
opts DriverOpts<C> undefined
shouldValidateCaps? boolean true

Defined in

appium/packages/base-driver/lib/basedriver/core.js:127

Properties

_eventHistory

_eventHistory: EventHistory

Defined in

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


_log

_log: AppiumLogger

Defined in

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


allowInsecure

allowInsecure: string[]

Defined in

appium/packages/base-driver/lib/basedriver/core.js:63


basePath

basePath: string

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

Defined in

appium/packages/base-driver/lib/basedriver/core.js:57


commandsQueueGuard

Protected commandsQueueGuard: AsyncLock

Defined in

appium/packages/base-driver/lib/basedriver/core.js:112


denyInsecure

denyInsecure: string[]

Defined in

appium/packages/base-driver/lib/basedriver/core.js:66


eventEmitter

eventEmitter: EventEmitter

Defined in

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


helpers

helpers: DriverHelpers

Defined in

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


implicitWaitMs

implicitWaitMs: number

Defined in

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


initialOpts

initialOpts: DriverOpts<C>

Defined in

appium/packages/base-driver/lib/basedriver/core.js:43


locatorStrategies

locatorStrategies: string[]

Defined in

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


managedDrivers

managedDrivers: Driver<Constraints, StringRecord<any>, StringRecord<any>, DefaultCreateSessionResult<Constraints>, void, StringRecord<any>>[]

Defined in

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


newCommandTimeoutMs

newCommandTimeoutMs: number

Defined in

appium/packages/base-driver/lib/basedriver/core.js:69


noCommandTimer

noCommandTimer: null | Timeout

Defined in

appium/packages/base-driver/lib/basedriver/core.js:84


opts

opts: DriverOpts<C>

Defined in

appium/packages/base-driver/lib/basedriver/core.js:38


protocol

protocol: undefined | string

Defined in

appium/packages/base-driver/lib/basedriver/core.js:270

appium/packages/base-driver/lib/basedriver/core.js:274


relaxedSecurityEnabled

relaxedSecurityEnabled: boolean

Defined in

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


sessionId

sessionId: null | string

Defined in

appium/packages/base-driver/lib/basedriver/core.js:33


settings

settings: DeviceSettings<Settings>

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

Defined in

appium/packages/base-driver/lib/basedriver/core.js:121


shouldValidateCaps

shouldValidateCaps: boolean

Defined in

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


shutdownUnexpectedly

shutdownUnexpectedly: boolean

Defined in

appium/packages/base-driver/lib/basedriver/core.js:101


webLocatorStrategies

webLocatorStrategies: string[]

Defined in

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


baseVersion

Static baseVersion: string = BASEDRIVER_VER

Make the basedriver version available so for any driver which inherits from this package, we know which version of basedriver it inherited from

Defined in

appium/packages/base-driver/lib/basedriver/core.js:28

Accessors

driverData

get driverData(): DriverData

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

DriverData

Defined in

appium/packages/base-driver/lib/basedriver/core.js:185


eventHistory

get eventHistory(): EventHistory

Returns

EventHistory

Defined in

appium/packages/base-driver/lib/basedriver/core.js:208


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.

Defined in

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


log

get log(): AppiumLogger

Returns

AppiumLogger

Defined in

appium/packages/base-driver/lib/basedriver/core.js:162

Methods

addManagedDriver

addManagedDriver(driver): void

Parameters

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

Returns

void

Defined in

appium/packages/base-driver/lib/basedriver/core.js:418


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

Defined in

appium/packages/base-driver/lib/basedriver/core.js:322


canProxy

canProxy(sessionId?): boolean

Parameters

Name Type
sessionId? string

Returns

boolean

Defined in

appium/packages/base-driver/lib/basedriver/core.js:377


clearNewCommandTimeout

clearNewCommandTimeout(): Promise<void>

Returns

Promise<void>

Defined in

appium/packages/base-driver/lib/basedriver/core.js:426


driverForSession

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

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<C, StringRecord>

Defined in

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


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

Defined in

appium/packages/base-driver/lib/basedriver/core.js:312


getManagedDrivers

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

Returns

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

Defined in

appium/packages/base-driver/lib/basedriver/core.js:422


getProxyAvoidList

getProxyAvoidList(sessionId): RouteMatcher[]

Parameters

Name Type
sessionId string

Returns

RouteMatcher[]

Defined in

appium/packages/base-driver/lib/basedriver/core.js:368


getStatus

getStatus(): Promise<{}>

Returns

Promise<{}>

Defined in

appium/packages/base-driver/lib/basedriver/core.js:236


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

Defined in

appium/packages/base-driver/lib/basedriver/core.js:284


isMjsonwpProtocol

isMjsonwpProtocol(): boolean

Returns

boolean

Defined in

appium/packages/base-driver/lib/basedriver/core.js:261


isW3CProtocol

isW3CProtocol(): boolean

Returns

boolean

Defined in

appium/packages/base-driver/lib/basedriver/core.js:265


logEvent

logEvent(eventName): void

API method for driver developers to log timings for important events

Parameters

Name Type
eventName string

Returns

void

Defined in

appium/packages/base-driver/lib/basedriver/core.js:216


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

Defined in

appium/packages/base-driver/lib/basedriver/core.js:175


proxyActive

proxyActive(sessionId?): boolean

Parameters

Name Type
sessionId? string

Returns

boolean

Defined in

appium/packages/base-driver/lib/basedriver/core.js:359


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

Defined in

appium/packages/base-driver/lib/basedriver/core.js:394


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

Defined in

appium/packages/base-driver/lib/basedriver/core.js:246


setProtocolMJSONWP

setProtocolMJSONWP(): void

Returns

void

Defined in

appium/packages/base-driver/lib/basedriver/core.js:269


setProtocolW3C

setProtocolW3C(): void

Returns

void

Defined in

appium/packages/base-driver/lib/basedriver/core.js:273


validateLocatorStrategy

validateLocatorStrategy(strategy, webContext?): void

Parameters

Name Type Default value
strategy string undefined
webContext? boolean false

Returns

void

Defined in

appium/packages/base-driver/lib/basedriver/core.js:339