Skip to content

Interface: ISessionHandler<C, CreateResult, DeleteResult, SessionData>

@appium/types.ISessionHandler

An interface which creates and deletes sessions.

Type parameters

Name Type
C extends Constraints = Constraints
CreateResult DefaultCreateSessionResult<C>
DeleteResult DefaultDeleteSessionResult
SessionData extends StringRecord = StringRecord

Hierarchy

  • ISessionHandler

Driver

Table of contents

Methods

Methods

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

Defined in

packages/types/lib/driver.ts:430


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>

Defined in

packages/types/lib/driver.ts:444


getSession

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

Get the data for the current session

Returns

Promise<SingularSessionData<C, SessionData>>

A session data object

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

Defined in

packages/types/lib/driver.ts:451