Criteria

Main difference between the selenium JSON Criteria used to filter the object tree and get a subset of it. Used by the findElement and findElements methods.

Property criteria

filtering based on the properties of the elements.
property value
depth (integer) depth of the element tree that will be considered for the search. -1 to search the entire tree.
method name the kind of attribute to filter against. Can be one of the following : type (to filter by type of UIElement) , name , label, value
matching how the matching will be done.Possible values are exact, starts, contains, ends, regex;
l10n what kind of translation will be performed before the matching. Possible values are none,serverL10N. Can be extending for convinience to have client side l10n too, but that will be done before calling the protocol
expected the expected value for the matching.

Examples:

to get the elements with name == test

{"l10n":"none","expected":"test","matching":"exact","method":"name"}

to get all the UIAButton

{"l10n":"none","expected":"UIAButton","matching":"exact","method":"type"}

to get the elements with label starting with A

{"l10n":"none","expected":"A","matching":"starts","method":"label"}

Composition

Criteria can then be composed by combining several criteria using AND, OR and NOT and a list of criteria.

To get all the elements with a label starting with A, containing B and ending with C

{"AND": [
  {
    "expected": "A",
    "l10n": "none",
    "matching": "starts",
    "method": "label"
  },
  {
    "expected": "B",
    "l10n": "none",
    "matching": "contains",
    "method": "label"
  },
  {
    "expected": "C",
    "l10n": "none",
    "matching": "ends",
    "method": "label"
  }
]}

Empty criteria

{} matches all elements.

Commands:

HTTP Method Path Summary
GET /status Query the server's current status. + the applications it's linked to.
POST /session Create a new session.
GET /sessions Returns a list of the currently active sessions.
GET /session/:sessionId Retrieve the capabilities of the specified session.
DELETE /session/:sessionId Delete the session.
POST /session/:sessionId/timeouts Configure the amount of time that a particular type of operation can execute for before they are aborted and a |Timeout| error is returned to the client.
POST /session/:sessionId/timeouts/async_script Set the amount of time, in milliseconds, that asynchronous scripts executed by /session/:sessionId/execute_async are permitted to run before they are aborted and a |Timeout| error is returned to the client.
POST /session/:sessionId/timeouts/implicit_wait Set the amount of time the driver should wait when searching for elements.
GET /session/:sessionId/window_handle Retrieve the current window handle.
GET /session/:sessionId/window_handles Retrieve the list of all window handles available to the session.
GET /session/:sessionId/url Retrieve the URL of the current page.
POST /session/:sessionId/url Navigate to a new URL.
POST /session/:sessionId/forward Navigate forwards in the browser history, if possible.
POST /session/:sessionId/back Navigate backwards in the browser history, if possible.
POST /session/:sessionId/refresh Refresh the current page.
POST /session/:sessionId/execute Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame.
POST /session/:sessionId/execute_async Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame.
GET /session/:sessionId/screenshot Take a screenshot of the current page.
GET /session/:sessionId/ime/available_engines List all available engines on the machine.
GET /session/:sessionId/ime/active_engine Get the name of the active IME engine.
GET /session/:sessionId/ime/activated Indicates whether IME input is active at the moment (not if it's available.
POST /session/:sessionId/ime/deactivate De-activates the currently-active IME engine.
POST /session/:sessionId/ime/activate Make an engines that is available (appears on the listreturned by getAvailableEngines) active.
POST /session/:sessionId/frame Change focus to another frame on the page.
POST /session/:sessionId/window Change focus to another window.
DELETE /session/:sessionId/window Close the current window.
POST /session/:sessionId/window/:windowHandle/size Change the size of the specified window.
GET /session/:sessionId/window/:windowHandle/size Get the size of the specified window.
POST /session/:sessionId/window/:windowHandle/position Change the position of the specified window.
GET /session/:sessionId/window/:windowHandle/position Get the position of the specified window.
POST /session/:sessionId/window/:windowHandle/maximize Maximize the specified window if not already maximized.
GET /session/:sessionId/cookie Retrieve all cookies visible to the current page.
POST /session/:sessionId/cookie Set a cookie.
DELETE /session/:sessionId/cookie Delete all cookies visible to the current page.
DELETE /session/:sessionId/cookie/:name Delete the cookie with the given name.
GET /session/:sessionId/source Get the entire object tree.
GET /session/:sessionId/element/:id/source Get the object tree starting from the specified element
GET /session/:sessionId/title Get the current page title.
POST /session/:sessionId/element Search for an element on the page, starting from the document root.
POST /session/:sessionId/elements Search for multiple elements on the page, starting from the document root.
POST /session/:sessionId/element/active Get the element on the page that currently has focus.
GET /session/:sessionId/element/:id Describe the identified element.
POST /session/:sessionId/element/:id/element Search for an element on the page, starting from the identified element.
POST /session/:sessionId/element/:id/elements Search for multiple elements on the page, starting from the identified element.
POST /session/:sessionId/element/:id/click Click on an element.
POST /session/:sessionId/element/:id/submit Submit a FORM element.
GET /session/:sessionId/element/:id/text Returns the visible text for the element.
POST /session/:sessionId/element/:id/value Send a sequence of key strokes to an element.
POST /session/:sessionId/keys Send a sequence of key strokes to the active element.
GET /session/:sessionId/element/:id/name Query for an element's tag name.
POST /session/:sessionId/element/:id/clear Clear a TEXTAREA or text INPUT element's value.
GET /session/:sessionId/element/:id/selected Determine if an OPTION element, or an INPUT element of type checkbox or radiobutton is currently selected.
GET /session/:sessionId/element/:id/enabled Determine if an element is currently enabled.
GET /session/:sessionId/element/:id/attribute/:name Get the value of an element's attribute.
GET /session/:sessionId/element/:id/equals/:other Test if two element IDs refer to the same DOM element.
GET /session/:sessionId/element/:id/displayed Determine if an element is currently displayed.
GET /session/:sessionId/element/:id/location Determine an element's location on the page.
GET /session/:sessionId/element/:id/location_in_view Determine an element's location on the screen once it has been scrolled into view.
GET /session/:sessionId/element/:id/size Determine an element's size in pixels.
GET /session/:sessionId/element/:id/css/:propertyName Query the value of an element's computed CSS property.
GET /session/:sessionId/orientation Get the current browser orientation.
POST /session/:sessionId/orientation Set the browser orientation.
GET /session/:sessionId/alert_text Gets the text of the currently displayed JavaScript? alert(), confirm(), or prompt() dialog.
POST /session/:sessionId/alert_text Sends keystrokes to a JavaScript? prompt() dialog.
POST /session/:sessionId/accept_alert Accepts the currently displayed alert dialog.
POST /session/:sessionId/dismiss_alert Dismisses the currently displayed alert dialog.
POST /session/:sessionId/moveto Move the mouse by an offset of the specificed element.
POST /session/:sessionId/click Click any mouse button (at the coordinates set by the last moveto command).
POST /session/:sessionId/buttondown Click and hold the left mouse button (at the coordinates set by the last moveto command).
POST /session/:sessionId/buttonup Releases the mouse button previously held (where the mouse is currently at).
POST /session/:sessionId/doubleclick Double-clicks at the current mouse coordinates (set by moveto).
POST /session/:sessionId/touch/click Single tap on the touch enabled device.
POST /session/:sessionId/touch/down Finger down on the screen.
POST /session/:sessionId/touch/up Finger up on the screen.
POST session/:sessionId/touch/move Finger move on the screen.
POST session/:sessionId/touch/scroll Scroll on the touch screen using finger based motion events.
POST session/:sessionId/touch/scroll Scroll on the touch screen using finger based motion events.
POST session/:sessionId/touch/doubleclick Double tap on the touch screen using finger motion events.
POST session/:sessionId/touch/longclick Long press on the touch screen using finger motion events.
POST session/:sessionId/touch/flick Flick on the touch screen using finger motion events.
POST session/:sessionId/touch/flick Flick on the touch screen using finger motion events.
GET /session/:sessionId/location Get the current geo location.
POST /session/:sessionId/location Set the current geo location.
GET /session/:sessionId/local_storage Get all keys of the storage.
POST /session/:sessionId/local_storage Set the storage item for the given key.
DELETE /session/:sessionId/local_storage Clear the storage.
GET /session/:sessionId/local_storage/key/:key Get the storage item for the given key.
DELETE /session/:sessionId/local_storage/key/:key Remove the storage item for the given key.
GET /session/:sessionId/local_storage/size Get the number of items in the storage.
GET /session/:sessionId/session_storage Get all keys of the storage.
POST /session/:sessionId/session_storage Set the storage item for the given key.
DELETE /session/:sessionId/session_storage Clear the storage.
GET /session/:sessionId/session_storage/key/:key Get the storage item for the given key.
DELETE /session/:sessionId/session_storage/key/:key Remove the storage item for the given key.
GET /session/:sessionId/session_storage/size Get the number of items in the storage.
POST /session/:sessionId/log Get the log for a given log type.
GET /session/:sessionId/log/types Get available log types.

Command Detail

/status

GET /status

Query the server's current status. The server should respond with a general "HTTP 200 OK" response if it is alive and accepting commands. The response body should be a JSON object describing the state of the server and a description of the application linked setup for that server.. All server implementations should return two basic objects describing the server's current platform and when the server was built. All fields are optional; if omitted, the client should assume the value is uknown. Furthermore, server implementations may include additional fields not listed here.

Key Type Description
build object
build.version string A generic release label (i.e. "2.0rc3")
build.revision string The revision of the local source control client from which the server was built
build.time string A timestamp from when the server was built.
os object
os.arch string The current system architecture.
os.name string The name of the operating system the server is currently running on: "windows", "linux", etc.
os.version string The operating system version.
supportedApps array of objects List all the applications the server is aware of.An application is represented by its capabilities.
resources object json object . key = name of the resource, value = url to access the resource.

Returns:
{object} An object describing the general status of the server.
Example:
{
    "build": {
      "revision": "unknown",
      "time": "unknown",
      "version": "unknown"
    },
    "ios": {"simulatorVersion": "6.0"},
    "java": {"version": "1.6.0_35"},
    "os": {
      "arch": "x86_64",
      "name": "Mac OS X",
      "version": "10.7.4"
    },
    "supportedApps": [
      {
        "CFBundleDevelopmentRegion": "en",
        "CFBundleExecutable": "InternationalMountains",
        "CFBundleIconFile": "Icon.png",
        "CFBundleIdentifier": "com.yourcompany.InternationalMountains",
        "CFBundleInfoDictionaryVersion": "6.0",
        "CFBundleName": "InternationalMountains",
        "CFBundlePackageType": "APPL",
        "CFBundleSignature": "????",
        "CFBundleSupportedPlatforms": ["iPhoneSimulator"],
        "CFBundleVersion": "1.1",
        "DTPlatformName": "iphonesimulator",
        "DTSDKName": "iphonesimulator5.1",
        "LSRequiresIPhoneOS": true,
        "NSMainNibFile": "MainWindow",
        "UIDeviceFamily": [1],
        "applicationPath": "/Users/freynaud/Documents/workspace/ios-driver/server/target/test-classes/sampleApps/InternationalMountains.app",
        "device": "iPhone Simulator",
        "resources": {"CFBundleIconFile": "/wd/hub/resources/hash=-674408620"},
        "sdkVersion": "6.0",
        "supportedLanguages": [
          "zh-Hant",
          "en",
          "fr"
        ],
        "timeHack": true
      },
      {
        "CFBundleDevelopmentRegion": "en",
        "CFBundleDisplayName": "UICatalog",
        "CFBundleExecutable": "UICatalog",
        "CFBundleIconFile": "Icon.png",
        "CFBundleIconFiles": [
          "Icon.png",
          "Icon@2x.png",
          "Icon-72.png",
          "Icon-Small.png",
          "Icon-Small-50.png",
          "Icon-Small@2x.png"
        ],
        "CFBundleIdentifier": "com.yourcompany.UICatalog",
        "CFBundleInfoDictionaryVersion": "6.0",
        "CFBundleName": "UICatalog",
        "CFBundlePackageType": "APPL",
        "CFBundleSignature": "????",
        "CFBundleSupportedPlatforms": ["iPhoneSimulator"],
        "CFBundleVersion": "2.10",
        "DTPlatformName": "iphonesimulator",
        "DTSDKName": "iphonesimulator5.0",
        "LSRequiresIPhoneOS": true,
        "NSMainNibFile": "MainWindow",
        "UIDeviceFamily": [1],
        "applicationPath": "/Users/freynaud/Documents/workspace/ios-driver/server/target/test-classes/sampleApps/UICatalog.app",
        "device": "iPhone Simulator",
        "resources": {"CFBundleIconFile": "/wd/hub/resources/hash=-674408620"},
        "sdkVersion": "6.0",
        "supportedLanguages": ["en"],
        "timeHack": true
      }
    ]
}


/session

POST /session

Create a new session. The server should attempt to create a session that most closely matches the desired and required capabilities. Required capabilities have higher priority than desired capabilities and must be set for the session to be created.
JSON Parameters:
desiredCapabilities - {object} An object describing the session's desired capabilities removing desired vs required capabilities.Everything is required.
Returns:
A 303 See Other redirect to /session/:sessionId , where :sessionId is the ID of the newly created session.
Potential Errors:
SessionNotCreatedException - If a required capability could not be set.


/sessions

GET /sessions

Returns a list of the currently active sessions. Each session will be returned as a list of JSON objects with the following keys:

Key Type Description
id string The session ID.
capabilities object An object describing the session's capabilities.
Currently only 1 session can exist per driver. Only 1 instruments instance can run per OS

Returns:
{Array.<Object>} A list of the currently active sessions.
Example:
[{
    "capabilities": {
      "CFBundleDevelopmentRegion": "en",
      "CFBundleDisplayName": "UICatalog",
      "CFBundleExecutable": "UICatalog",
      "CFBundleIconFile": "Icon.png",
      "CFBundleIconFiles": [
        "Icon.png",
        "Icon@2x.png",
        "Icon-72.png",
        "Icon-Small.png",
        "Icon-Small-50.png",
        "Icon-Small@2x.png"
      ],
      "CFBundleIdentifier": "com.yourcompany.UICatalog",
      "CFBundleInfoDictionaryVersion": "6.0",
      "CFBundleName": "UICatalog",
      "CFBundlePackageType": "APPL",
      "CFBundleSignature": "????",
      "CFBundleSupportedPlatforms": ["iPhoneSimulator"],
      "CFBundleVersion": "2.10",
      "DTPlatformName": "iphonesimulator",
      "DTSDKName": "iphonesimulator5.0",
      "LSRequiresIPhoneOS": true,
      "NSMainNibFile": "MainWindow",
      "UIDeviceFamily": [1],
      "applicationPath": "/Users/freynaud/Documents/workspace/ios-driver/server/target/test-classes/sampleApps/UICatalog.app",
      "device": "iPhone Simulator",
      "sdkVersion": "6.0",
      "supportedLanguages": ["en"],
      "timeHack": true
    },
    "id": "107dadce-5ce9-4ecf-a639-de701ec7e42d"
}]
						
						


/session/:sessionId

GET /session/:sessionId

Retrieve the capabilities of the specified session.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{object} An object describing the session's capabilities.

DELETE /session/:sessionId

Delete the session.
URL Parameters:
:sessionId - ID of the session to route the command to.


/session/:sessionId/timeouts

POST /session/:sessionId/timeouts

Configure the amount of time that a particular type of operation can execute for before they are aborted and a |Timeout| error is returned to the client.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
type - {string} The type of operation to set the timeout for. Valid values are: "script" for script timeouts, "implicit" for modifying the implicit wait timeout and "page load" for setting a page load timeout.
ms - {number} The amount of time, in milliseconds, that time-limited commands are permitted to run.


/session/:sessionId/timeouts/async_script

POST /session/:sessionId/timeouts/async_script

Set the amount of time, in milliseconds, that asynchronous scripts executed by /session/:sessionId/execute_async are permitted to run before they are aborted and a |Timeout| error is returned to the client.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
ms - {number} The amount of time, in milliseconds, that time-limited commands are permitted to run.


/session/:sessionId/timeouts/implicit_wait

POST /session/:sessionId/timeouts/implicit_wait

Set the amount of time the driver should wait when searching for elements. When searching for a single element, the driver should poll the page until an element is found or the timeout expires, whichever occurs first. When searching for multiple elements, the driver should poll the page until at least one element is found or the timeout expires, at which point it should return an empty list.

If this command is never sent, the driver should default to an implicit wait of 0ms.

URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
ms - {number} The amount of time to wait, in milliseconds. This value has a lower bound of 0.


/session/:sessionId/window_handle

GET /session/:sessionId/window_handle

Retrieve the current window handle.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{string} The current window handle.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/window_handles

GET /session/:sessionId/window_handles

Retrieve the list of all window handles available to the session.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{Array.<string>} A list of window handles.


/session/:sessionId/url

GET /session/:sessionId/url

Retrieve the URL of the current page.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{string} The current URL.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.

POST /session/:sessionId/url

Navigate to a new URL.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
url - {string} The URL to navigate to.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/forward

POST /session/:sessionId/forward

Navigate forwards in the browser history, if possible.
URL Parameters:
:sessionId - ID of the session to route the command to.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/back

POST /session/:sessionId/back

Navigate backwards in the browser history, if possible.
URL Parameters:
:sessionId - ID of the session to route the command to.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/refresh

POST /session/:sessionId/refresh

Refresh the current page.
URL Parameters:
:sessionId - ID of the session to route the command to.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/execute

POST /session/:sessionId/execute

Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. The executed script is assumed to be synchronous and the result of evaluating the script is returned to the client.

The script argument defines the script to execute in the form of a function body. The value returned by that function will be returned to the client. The function will be invoked with the provided args array and the values may be accessed via the arguments object in the order specified.

Arguments may be any JSON-primitive, array, or JSON object. JSON objects that define a WebElement reference will be converted to the corresponding DOM element. Likewise, any WebElements in the script result will be returned to the client as WebElement JSON objects.

URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
script - {string} The script to execute.
args - {Array.<*>} The script arguments.
Returns:
{*} The script result.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If one of the script arguments is a WebElement that is not attached to the page's DOM.
JavaScriptError - If the script throws an Error.


/session/:sessionId/execute_async

POST /session/:sessionId/execute_async

Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. The executed script is assumed to be asynchronous and must signal that is done by invoking the provided callback, which is always provided as the final argument to the function. The value to this callback will be returned to the client.

Asynchronous script commands may not span page loads. If an unload event is fired while waiting for a script result, an error should be returned to the client.

The script argument defines the script to execute in teh form of a function body. The function will be invoked with the provided args array and the values may be accessed via the arguments object in the order specified. The final argument will always be a callback function that must be invoked to signal that the script has finished.

Arguments may be any JSON-primitive, array, or JSON object. JSON objects that define a WebElement reference will be converted to the corresponding DOM element. Likewise, any WebElements in the script result will be returned to the client as WebElement JSON objects.

URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
script - {string} The script to execute.
args - {Array.<*>} The script arguments.
Returns:
{*} The script result.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If one of the script arguments is a WebElement that is not attached to the page's DOM.
Timeout - If the script callback is not invoked before the timout expires. Timeouts are controlled by the /session/:sessionId/timeout/async_script command.
JavaScriptError - If the script throws an Error or if an unload event is fired while waiting for the script to finish.


/session/:sessionId/screenshot

GET /session/:sessionId/screenshot

Take a screenshot of the current page.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{string} The screenshot as a base64 encoded PNG.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/ime/available_engines

GET /session/:sessionId/ime/available_engines

List all available engines on the machine. To use an engine, it has to be present in this list.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{Array.<string>} A list of available engines
Potential Errors:
ImeNotAvailableException - If the host does not support IME


/session/:sessionId/ime/active_engine

GET /session/:sessionId/ime/active_engine

Get the name of the active IME engine. The name string is platform specific.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{string} The name of the active IME engine.
Potential Errors:
ImeNotAvailableException - If the host does not support IME


/session/:sessionId/ime/activated

GET /session/:sessionId/ime/activated

Indicates whether IME input is active at the moment (not if it's available.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{boolean} true if IME input is available and currently active, false otherwise
Potential Errors:
ImeNotAvailableException - If the host does not support IME


/session/:sessionId/ime/deactivate

POST /session/:sessionId/ime/deactivate

De-activates the currently-active IME engine.
URL Parameters:
:sessionId - ID of the session to route the command to.
Potential Errors:
ImeNotAvailableException - If the host does not support IME


/session/:sessionId/ime/activate

POST /session/:sessionId/ime/activate

Make an engines that is available (appears on the list returned by getAvailableEngines) active. After this call, the engine will be added to the list of engines loaded in the IME daemon and the input sent using sendKeys will be converted by the active engine. Note that this is a platform-independent method of activating IME (the platform-specific way being using keyboard shortcuts
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
engine - {string} Name of the engine to activate.
Potential Errors:
ImeActivationFailedException - If the engine is not available or if the activation fails for other reasons.
ImeNotAvailableException - If the host does not support IME


/session/:sessionId/frame

POST /session/:sessionId/frame

Change focus to another frame on the page. If the frame id is null , the server should switch to the page's default content.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
id - {string|number|null|WebElement JSON Object} Identifier for the frame to change focus to.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
NoSuchFrame - If the frame specified by id cannot be found.


/session/:sessionId/window

POST /session/:sessionId/window

Change focus to another window. The window to change focus to may be specified by its server assigned window handle, or by the value of its name attribute.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
name - {string} The window to change focus to.
Potential Errors:
NoSuchWindow - If the window specified by name cannot be found.

DELETE /session/:sessionId/window

Close the current window.
URL Parameters:
:sessionId - ID of the session to route the command to.
Potential Errors:
NoSuchWindow - If the currently selected window is already closed


/session/:sessionId/window/:windowHandle/size

POST /session/:sessionId/window/:windowHandle/size

Change the size of the specified window. If the :windowHandle URL parameter is "current", the currently active window will be resized.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
width - {number} The new window width.
height - {number} The new window height.

GET /session/:sessionId/window/:windowHandle/size

Get the size of the specified window. If the :windowHandle URL parameter is "current", the size of the currently active window will be returned.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{width: number, height: number} The size of the window.
Potential Errors:
NoSuchWindow - If the specified window cannot be found.


/session/:sessionId/window/:windowHandle/position

POST /session/:sessionId/window/:windowHandle/position

Change the position of the specified window. If the :windowHandle URL parameter is "current", the currently active window will be moved.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
x - {number} The X coordinate to position the window at, relative to the upper left corner of the screen.
y - {number} The Y coordinate to position the window at, relative to the upper left corner of the screen.
Potential Errors:
NoSuchWindow - If the specified window cannot be found.

GET /session/:sessionId/window/:windowHandle/position

Get the position of the specified window. If the :windowHandle URL parameter is "current", the position of the currently active window will be returned.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{x: number, y: number} The X and Y coordinates for the window, relative to the upper left corner of the screen.
Potential Errors:
NoSuchWindow - If the specified window cannot be found.


/session/:sessionId/window/:windowHandle/maximize

POST /session/:sessionId/window/:windowHandle/maximize

Maximize the specified window if not already maximized. If the :windowHandle URL parameter is "current", the currently active window will be maximized.
URL Parameters:
:sessionId - ID of the session to route the command to.
Potential Errors:
NoSuchWindow - If the specified window cannot be found.


/session/:sessionId/cookie

GET /session/:sessionId/cookie

Retrieve all cookies visible to the current page.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{Array.<object>} A list of cookies.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.

POST /session/:sessionId/cookie

Set a cookie. If the cookie path is not specified, it should be set to "/" . Likewise, if the domain is omitted, it should default to the current page's domain.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
cookie - {object} A JSON object defining the cookie to add.

DELETE /session/:sessionId/cookie

Delete all cookies visible to the current page.
URL Parameters:
:sessionId - ID of the session to route the command to.
Potential Errors:
InvalidCookieDomain - If the cookie's domain is not visible from the current page.
NoSuchWindow - If the currently selected window has been closed.
UnableToSetCookie - If attempting to set a cookie on a page that does not support cookies (e.g. pages with mime-type text/plain ).


/session/:sessionId/cookie/:name

DELETE /session/:sessionId/cookie/:name

Delete the cookie with the given name. This command should be a no-op if there is no such cookie visible to the current page.
URL Parameters:
:sessionId - ID of the session to route the command to.
:name - The name of the cookie to delete.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/source

GET /session/:sessionId/source

Get the entire object tree.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
attachScreenshot {boolean} if true, a 64 encoded screenshot of the element is returned.
translation {boolean} if true, the server side l10n is returned.
Returns:
{object} the current object tree.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
Example
{
  "deviceOrientation": 1,
  "screenshot" : "......"
  "tree": {
    "l10n": {
      "key": "sentenceFormat",
      "langs": [
        {"en": ["8,848 mètres was first climbed on Montagne 1 and has a height of 29 May 1953"]},
        {"zh": ["8,848 mètres ?Montagne 1??????????29 May 1953?"]},
        {"fr": ["Bien que 8,848 mètres de haut, Montagne 1 aient été montés la première fois 29 May 1953."]}
      ],
      "matches": 1
    },
    "label": "Bien que 8,848 mètres de haut, Montagne 1 aient été montés la première fois 29 May 1953.",
    "name": "Bien que 8,848 mètres de haut, Montagne 1 aient été montés la première fois 29 May 1953.",
    "rect": {
      "origin": {
        "x": 34,
        "y": 168
      },
      "size": {
        "height": 164,
        "width": 251
      }
    },
    "ref": 5,
    "type": "UIAStaticText",
    "value": "Bien que 8,848 mètres de haut, Montagne 1 aient été montés la première fois 29 May 1953."
  }
}
							


/session/:sessionId/title

GET /session/:sessionId/title

Get the current page title.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{string} The current page title.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/element

POST /session/:sessionId/element

Search for an element on the page, starting from the document root (its main window). The located element will be returned as a WebElement? JSON object. The table below lists the locator strategies that each server should support. Each locator must return the first matching element located in the DOM.

URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
depth - {int} the depth the element tree to be considered for the search
criteria - {object} The criteria used to filter the result. criteria
Returns:
{ELEMENT:string} A WebElement? JSON object for the located element.
Potential Errors:
NoSuchElement - If the element cannot be found.


/session/:sessionId/elements

POST /session/:sessionId/elements

Search for multiple elements on the page, starting from the document root. The located elements will be returned as a WebElement? JSON objects. The table below lists the locator strategies that each server should support. Elements should be returned in the order located in the DOM.

URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
depth - {int} the depth the element tree to be considered for the search
criteria - {object} The criteria used to filter the result. criteria
Returns:
{Array.<{ELEMENT:string}>} A list of WebElement? JSON objects for the located elements.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
XPathLookupError - If using XPath and the input expression is invalid.


/session/:sessionId/element/active

POST /session/:sessionId/element/active

Get the element on the page that currently has focus. The element will be returned as a WebElement? JSON object.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{ELEMENT:string} A WebElement? JSON object for the active element.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/element/:id

GET /session/:sessionId/element/:id

Describe the identified element.

Note: This command is reserved for future use; its return type is currently undefined.

URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.


/session/:sessionId/element/:id/element

POST /session/:sessionId/element/:id/element

Search for an element on the page, starting from the identified element. The located element will be returned as a WebElement? JSON object. The table below lists the locator strategies that each server should support. Each locator must return the first matching element located in the DOM.

URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
JSON Parameters:
depth - {int} the depth the element tree to be considered for the search
criteria - {object} The criteria used to filter the result. criteria
Returns:
{ELEMENT:string} A WebElement? JSON object for the located element.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.
NoSuchElement - If the element cannot be found.
XPathLookupError - If using XPath and the input expression is invalid.


/session/:sessionId/element/:id/elements

POST /session/:sessionId/element/:id/elements

Search for multiple elements on the page, starting from the identified element. The located elements will be returned as a WebElement? JSON objects. The table below lists the locator strategies that each server should support. Elements should be returned in the order located in the DOM.

URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
JSON Parameters:
depth - {int} the depth the element tree to be considered for the search
criteria - {object} The criteria used to filter the result. criteria
Returns:
{Array.<{ELEMENT:string}>} A list of WebElement? JSON objects for the located elements.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.
XPathLookupError - If using XPath and the input expression is invalid.


/session/:sessionId/element/:id/click

POST /session/:sessionId/element/:id/click

Click on an element.
URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.
ElementNotVisible - If the referenced element is not visible on the page (either is hidden by CSS, has 0-width, or has 0-height)


/session/:sessionId/element/:id/submit

POST /session/:sessionId/element/:id/submit

Submit a FORM element. The submit command may also be applied to any element that is a descendant of a FORM element.
URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.


/session/:sessionId/element/:id/text

GET /session/:sessionId/element/:id/text

Returns the visible text for the element.
URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.


/session/:sessionId/element/:id/value

POST /session/:sessionId/element/:id/value

Send a sequence of key strokes to an element.

Any UTF-8 character may be specified, however, if the server does not support native key events, it should simulate key strokes for a standard US keyboard layout. The Unicode Private Use Area code points, 0xE000-0xF8FF, are used to represent pressable, non-text keys (see table below).

Key Code
NULL U+E000
Cancel U+E001
Help U+E002
Back space U+E003
Tab U+E004
Clear U+E005
Return1 U+E006
Enter1 U+E007
Shift U+E008
Control U+E009
Alt U+E00A
Pause U+E00B
Escape U+E00C

Key Code
Space U+E00D
Pageup U+E00E
Pagedown U+E00F
End U+E010
Home U+E011
Left arrow U+E012
Up arrow U+E013
Right arrow U+E014
Down arrow U+E015
Insert U+E016
Delete U+E017
Semicolon U+E018
Equals U+E019

Key Code
Numpad 0 U+E01A
Numpad 1 U+E01B
Numpad 2 U+E01C
Numpad 3 U+E01D
Numpad 4 U+E01E
Numpad 5 U+E01F
Numpad 6 U+E020
Numpad 7 U+E021
Numpad 8 U+E022
Numpad 9 U+E023

Key Code
Multiply U+E024
Add U+E025
Separator U+E026
Subtract U+E027
Decimal U+E028
Divide U+E029

Key Code
F1 U+E031
F2 U+E032
F3 U+E033
F4 U+E034
F5 U+E035
F6 U+E036
F7 U+E037
F8 U+E038
F9 U+E039
F10 U+E03A
F11 U+E03B
F12 U+E03C
Command/Meta U+E03D

1 The return key is not the same as the enter key.

The server must process the key sequence as follows:

  • Each key that appears on the keyboard without requiring modifiers are sent as a keydown followed by a key up.
  • If the server does not support native events and must simulate key strokes with JavaScript, it must generate keydown, keypress, and keyup events, in that order. The keypress event should only be fired when the corresponding key is for a printable character.
  • If a key requires a modifier key (e.g. "!" on a standard US keyboard), the sequence is: modifier down, key down, key up, modifier up, where key is the ideal unmodified key value (using the previous example, a "1").
  • Modifier keys (Ctrl, Shift, Alt, and Command/Meta) are assumed to be "sticky"; each modifier should be held down (e.g. only a keydown event) until either the modifier is encountered again in the sequence, or the NULL (U+E000) key is encountered.
  • Each key sequence is terminated with an implicit NULL key. Subsequently, all depressed modifier keys must be released (with corresponding keyup events) at the end of the sequence.
URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
JSON Parameters:
value - {Array.<string>} The sequence of keys to type. An array must be provided. The server should flatten the array items to a single string to be typed.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.
ElementNotVisible - If the referenced element is not visible on the page (either is hidden by CSS, has 0-width, or has 0-height)


/session/:sessionId/keys

POST /session/:sessionId/keys

Send a sequence of key strokes to the active element. This command is similar to the send keys command in every aspect except the implicit termination: The modifiers are not released at the end of the call. Rather, the state of the modifier keys is kept between calls, so mouse interactions can be performed while modifier keys are depressed.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
value - {Array.<string>} The keys sequence to be sent. The sequence is defined in thesend keys command.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/element/:id/name

GET /session/:sessionId/element/:id/name

Query for an element's tag name.
URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
Returns:
{string} The element's tag name, as a lowercase string.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.


/session/:sessionId/element/:id/clear

POST /session/:sessionId/element/:id/clear

Clear a TEXTAREA or text INPUT element's value.
URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.
ElementNotVisible - If the referenced element is not visible on the page (either is hidden by CSS, has 0-width, or has 0-height)
InvalidElementState - If the referenced element is disabled.


/session/:sessionId/element/:id/selected

GET /session/:sessionId/element/:id/selected

Determine if an OPTION element, or an INPUT element of type checkbox or radiobutton is currently selected.
URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
Returns:
{boolean} Whether the element is selected.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.


/session/:sessionId/element/:id/enabled

GET /session/:sessionId/element/:id/enabled

Determine if an element is currently enabled.
URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
Returns:
{boolean} Whether the element is enabled.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.


/session/:sessionId/element/:id/attribute/:name

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

Get the value of an element's attribute.
URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
Returns:
{string|null} The value of the attribute, or null if it is not set on the element.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.


/session/:sessionId/element/:id/equals/:other

GET /session/:sessionId/element/:id/equals/:other

Test if two element IDs refer to the same DOM element.
URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
:other - ID of the element to compare against.
Returns:
{boolean} Whether the two IDs refer to the same element.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If either the element refered to by :id or :other is no longer attached to the page's DOM.


/session/:sessionId/element/:id/displayed

GET /session/:sessionId/element/:id/displayed

Determine if an element is currently displayed.
URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
Returns:
{boolean} Whether the element is displayed.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.


/session/:sessionId/element/:id/location

GET /session/:sessionId/element/:id/location

Determine an element's location on the page. The point (0, 0) refers to the upper-left corner of the page. The element's coordinates are returned as a JSON object with x and y properties.
URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
Returns:
{x:number, y:number} The X and Y coordinates for the element on the page.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.


/session/:sessionId/element/:id/location_in_view

GET /session/:sessionId/element/:id/location_in_view

Determine an element's location on the screen once it has been scrolled into view.

Note: This is considered an internal command and should only be used to determine an element's location for correctly generating native events.

URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
Returns:
{x:number, y:number} The X and Y coordinates for the element.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.


/session/:sessionId/element/:id/size

GET /session/:sessionId/element/:id/size

Determine an element's size in pixels. The size will be returned as a JSON object with width and height properties.
URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
Returns:
{width:number, height:number} The width and height of the element, in pixels.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.


/session/:sessionId/element/:id/css/:propertyName

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

Query the value of an element's computed CSS property. The CSS property to query should be specified using the CSS property name, not the JavaScript property name (e.g. background-color instead of backgroundColor ).
URL Parameters:
:sessionId - ID of the session to route the command to.
:id - ID of the element to route the command to.
Returns:
{string} The value of the specified CSS property.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.
StaleElementReference - If the element referenced by :id is no longer attached to the page's DOM.


/session/:sessionId/orientation

GET /session/:sessionId/orientation

Get the current browser orientation. The server should return a valid orientation value as defined in ScreenOrientation: {LANDSCAPE|PORTRAIT} .
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{string} The current browser orientation corresponding to a value defined in ScreenOrientation: {LANDSCAPE|PORTRAIT} .
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.

POST /session/:sessionId/orientation

Set the browser orientation. The orientation should be specified as defined in ScreenOrientation: {LANDSCAPE|PORTRAIT} .
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
orientation - {string} The new browser orientation as defined in ScreenOrientation: {LANDSCAPE|PORTRAIT} .
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/alert_text

GET /session/:sessionId/alert_text

Gets the text of the currently displayed JavaScript? alert() , confirm() , or prompt() dialog.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{string} The text of the currently displayed alert.
Potential Errors:
NoAlertPresent - If there is no alert displayed.

POST /session/:sessionId/alert_text

Sends keystrokes to a JavaScript? prompt() dialog.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
text - {string} Keystrokes to send to the prompt() dialog.
Potential Errors:
NoAlertPresent - If there is no alert displayed.


/session/:sessionId/accept_alert

POST /session/:sessionId/accept_alert

Accepts the currently displayed alert dialog. Usually, this is equivalent to clicking on the 'OK' button in the dialog.
URL Parameters:
:sessionId - ID of the session to route the command to.
Potential Errors:
NoAlertPresent - If there is no alert displayed.


/session/:sessionId/dismiss_alert

POST /session/:sessionId/dismiss_alert

Dismisses the currently displayed alert dialog. For confirm() and prompt() dialogs, this is equivalent to clicking the 'Cancel' button. For alert() dialogs, this is equivalent to clicking the 'OK' button.
URL Parameters:
:sessionId - ID of the session to route the command to.
Potential Errors:
NoAlertPresent - If there is no alert displayed.


/session/:sessionId/moveto

POST /session/:sessionId/moveto

Move the mouse by an offset of the specificed element. If no element is specified, the move is relative to the current mouse cursor. If an element is provided but no offset, the mouse will be moved to the center of the element. If the element is not visible, it will be scrolled into view.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
element - {string} Opaque ID assigned to the element to move to, as described in the WebElement? JSON Object. If not specified or is null, the offset is relative to current position of the mouse.
xoffset - {number} X offset to move to, relative to the top-left corner of the element. If not specified, the mouse will move to the middle of the element.
yoffset - {number} Y offset to move to, relative to the top-left corner of the element. If not specified, the mouse will move to the middle of the element.


/session/:sessionId/click

POST /session/:sessionId/click

Click any mouse button (at the coordinates set by the last moveto command). Note that calling this command after calling buttondown and before calling button up (or any out-of-order interactions sequence) will yield undefined behaviour).
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
button - {number} Which button, enum: {LEFT = 0, MIDDLE = 1 , RIGHT = 2} . Defaults to the left mouse button if not specified.


/session/:sessionId/buttondown

POST /session/:sessionId/buttondown

Click and hold the left mouse button (at the coordinates set by the last moveto command). Note that the next mouse-related command that should follow is buttondown . Any other mouse command (such as click or another call to buttondown) will yield undefined behaviour.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
button - {number} Which button, enum: {LEFT = 0, MIDDLE = 1 , RIGHT = 2} . Defaults to the left mouse button if not specified.


/session/:sessionId/buttonup

POST /session/:sessionId/buttonup

Releases the mouse button previously held (where the mouse is currently at). Must be called once for every buttondown command issued. See the note in click and buttondown about implications of out-of-order commands.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
button - {number} Which button, enum: {LEFT = 0, MIDDLE = 1 , RIGHT = 2} . Defaults to the left mouse button if not specified.


/session/:sessionId/doubleclick

POST /session/:sessionId/doubleclick

Double-clicks at the current mouse coordinates (set by moveto).
URL Parameters:
:sessionId - ID of the session to route the command to.


/session/:sessionId/touch/click

POST /session/:sessionId/touch/click

Single tap on the touch enabled device.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
element - {string} ID of the element to single tap on.


/session/:sessionId/touch/down

POST /session/:sessionId/touch/down

Finger down on the screen.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
x - {number} X coordinate on the screen.
y - {number} Y coordinate on the screen.


/session/:sessionId/touch/up

POST /session/:sessionId/touch/up

Finger up on the screen.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
x - {number} X coordinate on the screen.
y - {number} Y coordinate on the screen.


session/:sessionId/touch/move

POST session/:sessionId/touch/move

Finger move on the screen.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
x - {number} X coordinate on the screen.
y - {number} Y coordinate on the screen.


session/:sessionId/touch/scroll

POST session/:sessionId/touch/scroll

Scroll on the touch screen using finger based motion events. Use this command to start scrolling at a particular screen location.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
element - {string} ID of the element where the scroll starts.
xoffset - {number} The x offset in pixels to scroll by.
yoffset - {number} The y offset in pixels to scroll by.


session/:sessionId/touch/scroll

POST session/:sessionId/touch/scroll

Scroll on the touch screen using finger based motion events. Use this command if you don't care where the scroll starts on the screen.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
xoffset - {number} The x offset in pixels to scrollby.
yoffset - {number} The y offset in pixels to scrollby.


session/:sessionId/touch/doubleclick

POST session/:sessionId/touch/doubleclick

Double tap on the touch screen using finger motion events.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
element - {string} ID of the element to double tap on.


session/:sessionId/touch/longclick

POST session/:sessionId/touch/longclick

Long press on the touch screen using finger motion events.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
element - {string} ID of the element to long press on.


session/:sessionId/touch/flick

POST session/:sessionId/touch/flick

Flick on the touch screen using finger motion events. This flickcommand starts at a particulat screen location.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
element - {string} ID of the element where the flick starts.
xoffset - {number} The x offset in pixels to flick by.
yoffset - {number} The y offset in pixels to flick by.
speed - {number} The speed in pixels per seconds.


session/:sessionId/touch/flick

POST session/:sessionId/touch/flick

Flick on the touch screen using finger motion events. Use this flick command if you don't care where the flick starts on the screen.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
xSpeed - {number} The x speed in pixels per second.
ySpeed - {number} The y speed in pixels per second.


/session/:sessionId/location

GET /session/:sessionId/location

Get the current geo location.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{latitude: number, longitude: number, altitude: number} The current geo location.

POST /session/:sessionId/location

Set the current geo location.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
location - {latitude: number, longitude: number, altitude: number} The new location.


/session/:sessionId/local_storage

GET /session/:sessionId/local_storage

Get all keys of the storage.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{Array.<string>} The list of keys.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.

POST /session/:sessionId/local_storage

Set the storage item for the given key.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
key - {string} The key to set.
value - {string} The value to set.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.

DELETE /session/:sessionId/local_storage

Clear the storage.
URL Parameters:
:sessionId - ID of the session to route the command to.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/local_storage/key/:key

GET /session/:sessionId/local_storage/key/:key

Get the storage item for the given key.
URL Parameters:
:sessionId - ID of the session to route the command to.
:key - The key to get.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.

DELETE /session/:sessionId/local_storage/key/:key

Remove the storage item for the given key.
URL Parameters:
:sessionId - ID of the session to route the command to.
:key - The key to remove.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/local_storage/size

GET /session/:sessionId/local_storage/size

Get the number of items in the storage.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{number} The number of items in the storage.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/session_storage

GET /session/:sessionId/session_storage

Get all keys of the storage.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{Array.<string>} The list of keys.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.

POST /session/:sessionId/session_storage

Set the storage item for the given key.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
key - {string} The key to set.
value - {string} The value to set.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.

DELETE /session/:sessionId/session_storage

Clear the storage.
URL Parameters:
:sessionId - ID of the session to route the command to.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/session_storage/key/:key

GET /session/:sessionId/session_storage/key/:key

Get the storage item for the given key.
URL Parameters:
:sessionId - ID of the session to route the command to.
:key - The key to get.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.

DELETE /session/:sessionId/session_storage/key/:key

Remove the storage item for the given key.
URL Parameters:
:sessionId - ID of the session to route the command to.
:key - The key to remove.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/session_storage/size

GET /session/:sessionId/session_storage/size

Get the number of items in the storage.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{number} The number of items in the storage.
Potential Errors:
NoSuchWindow - If the currently selected window has been closed.


/session/:sessionId/log

POST /session/:sessionId/log

Get the log for a given log type. Log buffer is reset after each request.
URL Parameters:
:sessionId - ID of the session to route the command to.
JSON Parameters:
type - {string} The log type. This must be provided.
Returns:
{Array.<object>} The list of log entries.


/session/:sessionId/log/types

GET /session/:sessionId/log/types

Get available log types.
URL Parameters:
:sessionId - ID of the session to route the command to.
Returns:
{Array.<string>} The list of available log types.