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. |
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"}
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" } ]}
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. |
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. |
{ "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 } ] }
Key | Type | Description |
id | string | The session ID. |
capabilities | object | An object describing the session's capabilities. |
[{ "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" }]
If this command is never sent, the driver should default to an implicit wait of 0ms.
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.
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.
{ "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." } }
Note: This command is reserved for future use; its return type is currently undefined.
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).
|
|
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 The return key is not the same as the enter key. |
The server must process the key sequence as follows:
Note: This is considered an internal command and should only be used to determine an element's location for correctly generating native events.