JSON Wire Protocol
The JSONWireProtocol is decrecated and replaced by the WebDriver protocol.
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. 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 unknown. Furthermore, server implementations may include additional fields not listed here.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.status()
Returnsβ
- <Object>
status
: An object describing the general status of the server.
newSessionβ
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 Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.newSession(desiredCapabilities, requiredCapabilities)
Parametersβ
Name | Type | Details |
---|---|---|
desiredCapabilities | object | An object describing the session's desired capabilities. |
requiredCapabilities optional | object | An object describing the session's required capabilities (Optional). |
Returnsβ
- <Object>
capabilities
: An object describing the session's capabilities.
getSessionsβ
Returns a list of the currently active sessions. Each session will be returned as a list of JSON objects containing id
and capabilities
.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getSessions()
Returnsβ
- <Object[]>
capabilities
: A list of the currently active sessions.
getSessionβ
Retrieve the capabilities of the specified session.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getSession()
Returnsβ
- <Object>
capabilities
: An object describing the session's capabilities.
deleteSessionβ
Delete the session.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.deleteSession()
setTimeoutsβ
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.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.setTimeouts(type, ms)
Parametersβ
Name | Type | Details |
---|---|---|
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 |
setAsyncTimeoutβ
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.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.setAsyncTimeout(ms)
Parametersβ
Name | Type | Details |
---|---|---|
ms | number | The amount of time, in milliseconds, that time-limited commands are permitted to run |
setImplicitTimeoutβ
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.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.setImplicitTimeout(ms)
Parametersβ
Name | Type | Details |
---|---|---|
ms | number | The amount of time, in milliseconds, to wait on an element. |
getUrlβ
Retrieve the URL of the current page.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getUrl()
Returnsβ
- <String>
url
: The current URL.
navigateToβ
Navigate to a new URL.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.navigateTo(url)
Parametersβ
Name | Type | Details |
---|---|---|
url | string | The URL to navigate to. |
backβ
Navigate backwards in the browser history, if possible.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.back()
forwardβ
Navigate forwards in the browser history, if possible.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.forward()
refreshβ
Refresh the current page.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.refresh()
getTitleβ
Get the current page title.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getTitle()
Returnsβ
- <String>
title
: The current page title.
getWindowHandleβ
Retrieve the current window handle.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getWindowHandle()
Returnsβ
- <String>
windowHandle
: The current window handle.
getWindowHandlesβ
Retrieve the list of all window handles available to the session.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getWindowHandles()
Returnsβ
- <String[]>
windowHandles
: A list of window handles.
closeWindowβ
Close the current window.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.closeWindow()
switchToWindowβ
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.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.switchToWindow(name)
Parametersβ
Name | Type | Details |
---|---|---|
name | string | The window to change focus to |
switchToFrameβ
Change focus to another frame on the page. If the frame id
is null
, the server should switch to the page's default content.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.switchToFrame(id)
Parametersβ
Name | Type | Details |
---|---|---|
id | string, number, object, null | Identifier for the frame to change focus to |
switchToParentFrameβ
Change focus to the parent context. If the current context is the top level browsing context, the context remains unchanged.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.switchToParentFrame()
getWindowPositionβ
Get the position of the current focussed window.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getWindowPosition()
Returnsβ
- <Object>
positon
: The X and Y coordinates for the window, relative to the upper left corner of the screen.
setWindowPositionβ
Change the position of the current focussed window.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.setWindowPosition(x, y)
Parametersβ
Name | Type | Details |
---|---|---|
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. |
Returnsβ
- <Object>
positon
: The X and Y coordinates for the window, relative to the upper left corner of the screen.
_getWindowSizeβ
Get the size of the current focused window.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser._getWindowSize()
Returnsβ
- <Object>
size
: The size of the window.
_setWindowSizeβ
Change the size of the current focused window.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser._setWindowSize(width, height)
Parametersβ
Name | Type | Details |
---|---|---|
width | number | the new window width |
height | number | the new window height |
maximizeWindowβ
Maximize the current focused window if not already maximized.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.maximizeWindow()
findElementβ
Search for an element on the page, starting from the document root. 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.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.findElement(using, value)
Parametersβ
Name | Type | Details |
---|---|---|
using | string | the locator strategy to use |
value | string | the search target |
Returnsβ
- <object>
ELEMENT
: A WebElement JSON object for the located element.
findElementsβ
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.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.findElements(using, value)
Parametersβ
Name | Type | Details |
---|---|---|
using | string | the locator strategy to use |
value | string | the search target |
Returnsβ
- <object[]>
ELEMENTS
: A list of WebElement JSON objects for the located elements.
findElementFromElementβ
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.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.findElementFromElement(elementId, using, value)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
using | string | the locator strategy to use |
value | string | the search target |
Returnsβ
- <object>
ELEMENT
: A WebElement JSON object for the located element.
findElementsFromElementβ
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.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.findElementsFromElement(elementId, using, value)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
using | string | the locator strategy to use |
value | string | the search target |
Returnsβ
- <object[]>
ELEMENTS
: A list of WebElement JSON objects for the located elements.
getActiveElementβ
Get the element on the page that currently has focus. The element will be returned as a WebElement JSON object.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getActiveElement()
Returnsβ
- <String>
ELEMENT
: A WebElement JSON object for the active element.
isElementSelectedβ
Determine if an OPTION
element, or an INPUT
element of type checkbox
or radiobutton
is currently selected.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.isElementSelected(elementId)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
Returnsβ
- <Boolean>
isSelected
: Whether the element is selected.
isElementDisplayedβ
Determine if an element is currently displayed.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.isElementDisplayed(elementId)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
Returnsβ
- <Boolean>
isDisplayed
: Whether the element is displayed.
getElementAttributeβ
Get the value of an element's attribute.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getElementAttribute(elementId, name)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
name | String | name of the attribute value to retrieve |
Returnsβ
- <String|Null>
attribute
: The value of the attribute, or null if it is not set on the element.
getElementCSSValueβ
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
).
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getElementCSSValue(elementId, propertyName)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
propertyName | String | name of the CSS property to retrieve |
Returnsβ
- <String>
propertyName
: The value of the specified CSS property.
getElementTextβ
Returns the visible text for the element.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getElementText(elementId)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
Returnsβ
- <String>
text
: The visible text of the element.
getElementTagNameβ
Query for an element's tag name.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getElementTagName(elementId)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
Returnsβ
- <String>
tagName
: The element's tag name, as a lowercase string.
getElementLocationβ
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.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getElementLocation(elementId)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
Returnsβ
- <Object>
location
: The X and Y coordinates for the element on the page.
getElementLocationInViewβ
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.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getElementLocationInView(elementId)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
Returnsβ
- <Object>
location
: The X and Y coordinates for the element on the page.
getElementSizeβ
Determine an element's size in pixels. The size will be returned as a JSON object with width
and height
properties.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getElementSize(elementId)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
Returnsβ
- <Object>
size
: The width and height of the element, in pixels.
isElementEnabledβ
Determine if an element is currently enabled.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.isElementEnabled(elementId)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
Returnsβ
- <Boolean>
isEnabled
: Whether the element is enabled.
elementClickβ
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).
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.elementClick(elementId)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
elementEqualsβ
Compare elements with each other.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.elementEquals(elementId, otherElementId)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
otherElementId | String | ID of the element to compare against |
Returnsβ
- <Boolean>
isEqual
: Whether the two IDs refer to the same element.
elementSubmitβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.elementSubmit(elementId)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the form element to be submitted |
elementClearβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.elementClear(elementId)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
elementSendKeysβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.elementSendKeys(elementId, value)
Parametersβ
Name | Type | Details |
---|---|---|
elementId | String | ID of the element to route the command to |
value | string[] | The sequence of keys to type. An array must be provided. |
sendKeysβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.sendKeys(value)
Parametersβ
Name | Type | Details |
---|---|---|
value | string[] | The sequence of keys to type. An array must be provided. |
getPageSourceβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getPageSource()
Returnsβ
- <String>
source
: The current page source.
executeScriptβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.executeScript(script, args)
Parametersβ
Name | Type | Details |
---|---|---|
script | string | the script to execute |
args optional | string, object, number, boolean, undefined[] | the script arguments |
Returnsβ
- <*>
result
: The script result.
executeAsyncScriptβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.executeAsyncScript(script, args)
Parametersβ
Name | Type | Details |
---|---|---|
script | string | the script to execute |
args | string, object, number, boolean, undefined[] | the script arguments |
Returnsβ
- <*>
result
: The script result.
getAllCookiesβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getAllCookies()
Returnsβ
- <Object[]>
cookies
: A list of cookies.
addCookieβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.addCookie(cookie)
Parametersβ
Name | Type | Details |
---|---|---|
cookie | object | A JSON object representing a cookie. It must have at least the name and value fields and could have more, including expiry-time and so on |
deleteAllCookiesβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.deleteAllCookies()
deleteCookieβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.deleteCookie(name)
Parametersβ
Name | Type | Details |
---|---|---|
name | String | name of the cookie to retrieve |
dismissAlertβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.dismissAlert()
acceptAlertβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.acceptAlert()
getAlertTextβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getAlertText()
Returnsβ
- <String>
alertText
: The text of the currently displayed alert.
sendAlertTextβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.sendAlertText(text)
Parametersβ
Name | Type | Details |
---|---|---|
text | string | keystrokes to send to the prompt() dialog |
takeScreenshotβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.takeScreenshot()
Returnsβ
- <String>
screenshot
: screenshot as a base64 encoded PNG
getAvailableEnginesβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getAvailableEngines()
Returnsβ
- <String[]>
engines
: A list of available engines
getActiveEngineβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getActiveEngine()
Returnsβ
- <String>
engine
: The name of the active IME engine
isIMEActivatedβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.isIMEActivated()
Returnsβ
- <Boolean>
isActive
: true if IME input is available and currently active, false otherwise
deactivateIMEβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.deactivateIME()
activateIMEβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.activateIME(engine)
Parametersβ
Name | Type | Details |
---|---|---|
engine | string | name of the engine to activate |
getOrientationβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getOrientation()
Returnsβ
- <String>
orientation
: The current browser orientation corresponding to a value defined in ScreenOrientation: {LANDSCAPE|PORTRAIT}.
setOrientationβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.setOrientation(orientation)
Parametersβ
Name | Type | Details |
---|---|---|
orientation | string | the new browser orientation as defined in ScreenOrientation: {LANDSCAPE |
moveToElementβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.moveToElement(element, xoffset, yoffset)
Parametersβ
Name | Type | Details |
---|---|---|
element optional | string, null | 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 optional | 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 optional | 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 |
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 buttonup . Any other mouse command (such as click or another call to buttondown) will yield undefined behaviour.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.buttonDown(button)
Parametersβ
Name | Type | Details |
---|---|---|
button optional | number | which button, enum: LEFT = 0, MIDDLE = 1 , RIGHT = 2, defaults to the left mouse button if not specified |
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.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.buttonUp(button)
Parametersβ
Name | Type | Details |
---|---|---|
button optional | number | which button, enum: LEFT = 0, MIDDLE = 1 , RIGHT = 2, defaults to the left mouse button if not specified |
positionClickβ
Clicks at the current mouse coordinates (set by moveto).
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.positionClick(button)
Parametersβ
Name | Type | Details |
---|---|---|
button optional | number | which button, enum: LEFT = 0, RIGHT = 2, defaults to the left mouse button if not specified |
positionDoubleClickβ
Double-clicks at the current mouse coordinates (set by moveto).
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.positionDoubleClick()
touchClickβ
Single tap on the touch enabled device.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.touchClick(element)
Parametersβ
Name | Type | Details |
---|---|---|
element | string | ID of the element to single tap on. |
touchDownβ
Finger down on the screen.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.touchDown(x, y)
Parametersβ
Name | Type | Details |
---|---|---|
x | number | x coordinate on the screen |
y | number | y coordinate on the screen |
touchUpβ
Finger up on the screen.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.touchUp(x, y)
Parametersβ
Name | Type | Details |
---|---|---|
x | number | x coordinate on the screen |
y | number | y coordinate on the screen |
touchMoveβ
Finger move on the screen.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.touchMove(x, y)
Parametersβ
Name | Type | Details |
---|---|---|
x | number | x coordinate on the screen |
y | number | y coordinate on the screen |
touchScrollβ
Finger move on the screen.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.touchScroll(xoffset, yoffset, element)
Parametersβ
Name | Type | Details |
---|---|---|
xoffset | number | the x offset in pixels to scroll by |
yoffset | number | the y offset in pixels to scroll by |
element optional | string | ID of the element where the scroll starts |
touchDoubleClickβ
Double tap on the touch screen using finger motion events.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.touchDoubleClick(element)
Parametersβ
Name | Type | Details |
---|---|---|
element | string | ID of the element to double tap on |
touchLongClickβ
Long press on the touch screen using finger motion events.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.touchLongClick(element)
Parametersβ
Name | Type | Details |
---|---|---|
element | string | ID of the element to long press on |
touchFlickβ
Flick on the touch screen using finger motion events. This flickcommand starts at a particulat screen location.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.touchFlick(xoffset, yoffset, element, speed, xspeed, yspeed)
Parametersβ
Name | Type | Details |
---|---|---|
xoffset optional | number | the x offset in pixels to flick by |
yoffset optional | number | the y offset in pixels to flick by |
element optional | string | ID of the element where the flick starts |
speed optional | number | the speed in pixels per seconds |
xspeed optional | number | the x speed in pixels per second |
yspeed optional | number | the y speed in pixels per second |
getGeoLocationβ
Get the current geo location.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getGeoLocation()
Returnsβ
- <Object>
location
: The current geo location.
setGeoLocationβ
Set the current geo location.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.setGeoLocation(location)
Parametersβ
Name | Type | Details |
---|---|---|
location | object | the new location ({latitude: number, longitude: number, altitude: number} ) |
getLocalStorageβ
Get all keys of the storage.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getLocalStorage()
Returnsβ
- <String[]>
keys
: The list of keys.
setLocalStorageβ
Set the storage item for the given key.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.setLocalStorage(key, value)
Parametersβ
Name | Type | Details |
---|---|---|
key | string | the key to set |
value | string | the value to set |
clearLocalStorageβ
Clear the storage.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.clearLocalStorage()
getLocalStorageItemβ
Get the storage item for the given key.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getLocalStorageItem(key)
Parametersβ
Name | Type | Details |
---|---|---|
key | String | the key to get |
Returnsβ
- <String>
item
: The storage item of given key.
deleteLocalStorageItemβ
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.deleteLocalStorageItem(key)
Parametersβ
Name | Type | Details |
---|---|---|
key | String | the key to remove |
getLocalStorageSizeβ
Get the number of items in the storage.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getLocalStorageSize()
Returnsβ
- <Number>
itemCnt
: The number of items in the storage.
getSessionStorageβ
Get all keys of the storage.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getSessionStorage()
Returnsβ
- <String[]>
keys
: The list of keys.
setSessionStorageβ
Set the storage item for the given key.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.setSessionStorage(key, value)
Parametersβ
Name | Type | Details |
---|---|---|
key | string | the key to set |
value | string | the value to set |
clearSessionStorageβ
Clear the storage.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.clearSessionStorage()
getSessionStorageItemβ
Get the storage item for the given key.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getSessionStorageItem(key)
Parametersβ
Name | Type | Details |
---|---|---|
key | String | the key to get |
Returnsβ
- <String>
item
: The storage item of given key.
deleteSessionStorageItemβ
Remove the storage item for the given key.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.deleteSessionStorageItem(key)
Parametersβ
Name | Type | Details |
---|---|---|
key | String | the key to remove |
getSessionStorageSizeβ
Get the number of items in the storage.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getSessionStorageSize()
Returnsβ
- <Number>
itemCnt
: The number of items in the storage.
getLogsβ
Get the log for a given log type. Log buffer is reset after each request.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getLogs(type)
Parametersβ
Name | Type | Details |
---|---|---|
type | string | the log type |
Returnsβ
- <Object[]>
logs
: The list of log entries.
getLogTypesβ
Get available log types.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getLogTypes()
Returnsβ
- <String[]>
logTypes
: The list of available log types.
getApplicationCacheStatusβ
Get the status of the html5 application cache.
JSON Wire Protocol command. More details can be found in the official protocol docs.
Usageβ
browser.getApplicationCacheStatus()
Returnsβ
- <Number>
statusCode
: Status code for application cache:{UNCACHED = 0, IDLE = 1, CHECKING = 2, DOWNLOADING = 3, UPDATE_READY = 4, OBSOLETE = 5}