Skip to content

Driver: @appium/fake-driver

Commands

POST /session

Comment for createSession in FakeDriver

Param

W3C Capabilities

See

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

Remarks

The shape of this method is strange because it used to support both JSONWP and W3C capabilities. This will likely change in the future to simplify.

Parameters

Name Type
desiredCapabilities? W3CFakeDriverCaps
requiredCapabilities? W3CFakeDriverCaps
capabilities? W3CFakeDriverCaps

Response

[string, Partial<ConstraintsToCaps<typeof BASE_DESIRED_CAP_CONSTRAINTS & { app: { isString: true = true; presence: true = true } ; uniqueApp: { isBoolean: true = true } }> & void>]

Session ID and normalized capabilities

GET /session/:sessionId

Get the data for the current session

Response

SingularSessionData<typeof BASE_DESIRED_CAP_CONSTRAINTS, void>

A session data object

DELETE /session/:sessionId

Get the data for the current session

Response

SingularSessionData<typeof BASE_DESIRED_CAP_CONSTRAINTS, void>

A session data object

POST /session/:sessionId/accept_alert

Accept a simple dialog/alert

See

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

POST /session/:sessionId/actions

Release all keys or buttons that are currently pressed

See

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

Required Parameters
  • actions

DELETE /session/:sessionId/actions

Release all keys or buttons that are currently pressed

See

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

POST /session/:sessionId/alert/accept

Accept a simple dialog/alert

See

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

POST /session/:sessionId/alert/dismiss

Dismiss a simple dialog/alert

See

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

GET /session/:sessionId/alert/text

Set the text field of an alert prompt

See

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

Param

the text to send to the prompt

POST /session/:sessionId/alert/text

Set the text field of an alert prompt

See

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

Param

the text to send to the prompt

GET /session/:sessionId/alert_text

Set the text field of an alert prompt

See

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

Param

the text to send to the prompt

POST /session/:sessionId/alert_text

Set the text field of an alert prompt

See

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

Param

the text to send to the prompt

POST /session/:sessionId/appium/app/reset

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

Deprecated

Use explicit session management commands instead

Response

void

POST /session/:sessionId/appium/device/shake

Shake the device

Deprecated

POST /session/:sessionId/appium/events

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

Param

filter the returned events by including one or more types

Parameters

Name Type
type? string | string[]

Response

EventHistory | Record<string, number>

The event history for the session

POST /session/:sessionId/appium/log_event

Add a custom-named event to the Appium event log

Param

the name of the vendor or tool the event belongs to, to namespace the event

Parameters

Name Type
vendor string
event string

Response

void

POST /session/:sessionId/appium/settings

Get the current settings for the session

Required Parameters
  • settings

Response

StringRecord

The settings object

GET /session/:sessionId/appium/settings

Get the current settings for the session

Response

StringRecord

The settings object

GET /session/:sessionId/context

Switch to a context by name

See

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

Param

the context name

POST /session/:sessionId/context

Switch to a context by name

See

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

Param

the context name

Required Parameters
  • name

GET /session/:sessionId/contexts

Get the list of available contexts

See

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

POST /session/:sessionId/deprecated

This is a command that exists just to be an example of a deprecated command

Response

void

POST /session/:sessionId/dismiss_alert

Dismiss a simple dialog/alert

See

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

POST /session/:sessionId/doubleclick

Double-click the current mouse location

Deprecated

Use the Actions API instead

POST /session/:sessionId/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

Param

the locator strategy

Required Parameters
  • using
  • value

GET /session/:sessionId/element/:elementId/attribute/:name

Retrieve the value of an element's attribute

See

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

Param

the attribute name

POST /session/:sessionId/element/:elementId/clear

Clear the text/value of an editable element

See

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

Param

the id of the element

POST /session/:sessionId/element/:elementId/click

Click/tap an element

See

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

Param

the id of the element

GET /session/:sessionId/element/:elementId/css/:propertyName

Retrieve the value of a CSS property of an element

See

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

Param

the CSS property name

GET /session/:sessionId/element/:elementId/displayed

Determine whether an element is displayed

See

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

Param

the id of the element

POST /session/:sessionId/element/:elementId/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

Param

the locator strategy

Required Parameters
  • using
  • value

POST /session/:sessionId/element/:elementId/elements

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

Param

the locator strategy

Required Parameters
  • using
  • value

GET /session/:sessionId/element/:elementId/enabled

Determine whether an element is enabled

See

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

Param

the id of the element

GET /session/:sessionId/element/:elementId/location

Get the position of an element on screen

Param

the element ID

Deprecated

Use getElementRect instead

GET /session/:sessionId/element/:elementId/location_in_view

Get the position of an element on screen within a certain other view

Param

the element ID

Deprecated

Use getElementRect instead

GET /session/:sessionId/element/:elementId/name

Get the tag name of an element

See

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

Param

the id of the element

GET /session/:sessionId/element/:elementId/selected

Determine if the reference element is selected or not

See

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

Param

the id of the element

GET /session/:sessionId/element/:elementId/text

Get the text of an element as rendered

See

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

Param

the id of the element

POST /session/:sessionId/element/:elementId/value

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

See

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

Param

the text to send to the element

Optional Parameters
  • value
  • text

POST /session/:sessionId/elements

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

Param

the locator strategy

Required Parameters
  • using
  • value

POST /session/:sessionId/execute

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

See

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

Param

the string to be evaluated as the script, which will be made the body of an anonymous function in the case of JS

Required Parameters
  • script
  • args

POST /session/:sessionId/execute/sync

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

See

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

Param

the string to be evaluated as the script, which will be made the body of an anonymous function in the case of JS

Required Parameters
  • script
  • args

GET /session/:sessionId/fakedriver

Response

any

POST /session/:sessionId/fakedriver

Sets a fake thing

Param

Parameters

Name Type
thing any

Response

null

GET /session/:sessionId/fakedriverargs

Get the driver args that were sent in via the CLI

Response

StringRecord & ServerArgs

POST /session/:sessionId/frame

Switch the current browsing context to a frame

See

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

Param

the frame id, index, or null (indicating the top-level context)

Required Parameters
  • id

POST /session/:sessionId/keys

Send keys to the app

Param

the array of keys to send

Deprecated

Use the W3C send keys method instead

Required Parameters
  • value

GET /session/:sessionId/location

Get the virtual or real geographical location of a device

POST /session/:sessionId/location

Get the virtual or real geographical location of a device

Required Parameters
  • location

POST /session/:sessionId/log

Get the log for a given log type.

Param

Name/key of log type as defined in ILogCommands.supportedLogTypes.

Required Parameters
  • type

GET /session/:sessionId/log/types

Get available log types as a list of strings

Response

string[]

GET /session/:sessionId/orientation

Set the device orientation

Param

the orientation string

POST /session/:sessionId/orientation

Set the device orientation

Param

the orientation string

Required Parameters
  • orientation

GET /session/:sessionId/screenshot

Get a screenshot of the current document as rendered

See

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

POST /session/:sessionId/se/log

Get the log for a given log type.

Param

Name/key of log type as defined in ILogCommands.supportedLogTypes.

Required Parameters
  • type

GET /session/:sessionId/se/log/types

Get available log types as a list of strings

Response

string[]

POST /session/:sessionId/shadow/:shadowId/element

Find an element from a shadow root

See

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

Param

the locator strategy

Parameters

Name Type
using string
value string

Response

Element

The element inside the shadow root matching the selector

POST /session/:sessionId/shadow/:shadowId/elements

Find elements from a shadow root

See

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

Param

the locator strategy

Parameters

Name Type
using string
value string

Response

Element[]

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

GET /session/:sessionId/source

Get the current page/app source as HTML/XML

See

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

GET /session/:sessionId/timeouts

Get the current timeouts

See

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

Response

Record<string, number>

A map of timeout names to ms values

POST /session/:sessionId/timeouts

Get the current timeouts

See

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

Optional Parameters
  • type
  • ms
  • script
  • pageLoad
  • implicit

Response

Record<string, number>

A map of timeout names to ms values

POST /session/:sessionId/timeouts/implicit_wait

Set the implicit wait timeout

Param

the timeout in ms

Deprecated

Use timeouts instead

Parameters

Name Type
ms string | number

Response

void

GET /session/:sessionId/title


GENERAL *


See

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

Examples

JavaScript
await driver.getTitle()
Python
driver.title
Java
driver.getTitle();

POST /session/:sessionId/touch/click

Click/tap an element

See

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

Param

the id of the element

Required Parameters
  • element

GET /session/:sessionId/window/:windowhandle/size

Get the window size

Deprecated

Use getWindowRect instead

GET /session/:sessionId/window/rect

Get the size and position of the current window

See

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

POST /session/:sessionId/window/rect

Get the size and position of the current window

See

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

Required Parameters
  • x
  • y
  • width
  • height

GET /sessions

Get data for all sessions running on an Appium server

Response

MultiSessionData<typeof BASE_DESIRED_CAP_CONSTRAINTS, void>[]

A list of session data objects

GET /status

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.

Examples

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

# ruby_lib_core example
@driver.remote_status

Response

Object

Execute Methods

Script: fake: addition

Route

POST /session/:sessionId/execute

Script: fake: getDeprecatedCommandsCalled

This is a command that will return a list of deprecated command names called

Route

POST /session/:sessionId/execute

Script: fake: getThing

Gets a thing (a fake thing)

Route

POST /session/:sessionId/execute

Script: fake: setThing

Set the 'thing' value (so that it can be retrieved later)

Param

Route

POST /session/:sessionId/execute