API Docs for: 0.0.6
Show:

FirefoxDriver.Commands.WebDriver.Element Class

Element related WebDriver endpoints see JsonWireProtocol

Methods

active

(
  • sessionId
  • elementId
)

Get the element on the page that currently has focus. The element will be returned as a WebElement JSON object.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

attribute

(
  • sessionId
  • elementId
  • attr
)

Get the value of an element's attribute.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

  • attr GET

    Attribute that should be fetched

childElement

(
  • sessionId
  • elementId
  • using
  • value
)

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.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

  • using POST

    The locator strategy to use. // Not yet supported

  • value POST

    The The search target.

childElements

(
  • sessionId
  • elementId
  • using
  • value
)

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.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

  • using POST

    The locator strategy to use. // Not yet supported

  • value POST

    The The search target.

clear

(
  • sessionId
  • elementId
)

Clear a TEXTAREA or text INPUT element's value

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

click

(
  • sessionId
  • elementId
)

Click on an element.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

cssProperty

(
  • sessionId
  • elementId
  • 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).

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

  • propertyName GET

    Name of the css property to fetch

displayed

(
  • sessionId
  • elementId
)

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.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

element

(
  • sessionId
  • using
  • value
)

Search for an element on the page, starting from the document root. The located element will be returned as a WebElement JSON object.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • using POST

    The locator strategy to use. // Not yet supported

  • value POST

    The The search target.

elementInfo

(
  • sessionId
  • elementId
)

Get the element on the page that currently has focus. The element will be returned as a WebElement JSON object.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

elements

(
  • sessionId
  • using
  • value
)

Search for multiple elements on the page, starting from the document root. The located element will be returned as a WebElement JSON object.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • using POST

    The locator strategy to use. // Not yet supported

  • value POST

    The The search target.

enabled

(
  • sessionId
  • elementId
)

Determine if an element is currently enabled

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

equals

(
  • sessionId
  • elementId
  • other
)

Test if two element IDs refer to the same DOM element

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

  • other GET

    ID of the element to compare

keys

(
  • sessionId
  • value
)

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.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • value POST

    The keys sequence to be sent

location

(
  • sessionId
  • elementId
)

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.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

locationInView

(
  • sessionId
  • elementId
)

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.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

multiElementResponse

(
  • req
  • res
)
private

Generic multi elements response handler

Parameters:

  • req Object

    Original request

  • res Object

    Original response

parseElement

(
  • element
)
Object | Number private

Parses an element return value

Parameters:

  • element Object

    Marionette return value of an element call

Returns:

Object | Number:

Webdriver compatible element response

parseElements

(
  • element
)
Object | Number private

Parses multi elements return value

Parameters:

  • element Object

    Marionette return value of an elements call

Returns:

Object | Number:

Webdriver compatible elements response

selected

(
  • sessionId
  • elementId
)

Determine if an OPTION element, or an INPUT element of type checkbox or radiobutton is currently selected

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

singleElementResponse

(
  • req
  • res
)
private

Generic single element response handler

Parameters:

  • req Object

    Original request

  • res Object

    Original response

size

(
  • sessionId
  • elementId
)

Determine an element's size in pixels. The size will be returned as a JSON object with width and height properties.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

submit

(
  • sessionId
  • elementId
)

Submit a FORM element. The submit command may also be applied to any element that is a descendant of a FORM element.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

tagName

(
  • sessionId
  • elementId
)

Query for an element's tag name

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

text

(
  • sessionId
  • elementId
)

Returns the visible text for the element.

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

value

(
  • sessionId
  • elementId
  • value
)

Clears the contents of an element

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

  • value POST

    The keys sequence to be sent

value

(
  • sessionId
  • elementId
  • value
)

Send a sequence of key strokes to an element

Parameters:

  • sessionId GET

    ID of the session to route the command to

  • elementId GET

    ID of the element to route the command to

  • value POST

    The keys sequence to be sent