API Docs for: 0.1.0
Show:

WebElement Class

Defined in: lib\WebElement.js:1

An object representing an element inside the DOM

Methods

attr

(
  • attributeName
)
String | Null

Get the value of an element's attribute.

Parameters:

  • attributeName String

    Attribute name

Returns:

String | Null: The value of the attribute, or null if it is not set on the element.

clear

() chainable

Clear a TEXTAREA or text INPUT element's value.

click

() chainable

Click on an element.

css

(
  • propertyName
)
String

Query the value of an element's computed CSS property.

Parameters:

  • propertyName String

    CSS property name. 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).

Returns:

String: The value of the specified CSS property.

equals

(
  • other
)
Boolean

Test if the elements refer to the same DOM element.

Parameters:

  • other WebElement

    The other element to match with

Returns:

Boolean: Whether the two IDs refer to the same element.

offset

() X:number, y:number

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.

Returns:

X:number, y:number: The X and Y coordinates for the element on the page.

size

() Width:number, height:number

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

Returns:

Width:number, height:number: The width and height of the element, in pixels.

submit

() chainable

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

val

() chainable

Send a sequence of key strokes to an element.

Attributes

displayed

Boolean readonly

Determine if an element is currently displayed.

enabled

Boolean readonly

Determine if an element is currently enabled.

height

Number readonly

Determine an element's height in pixels.

name

String readonly

Determine an element's tag name.

selected

Boolean readonly

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

text

String readonly

Returns the visible text for the element.

text

String

Get or set the value of the element.

width

Number readonly

Determine an element's width in pixels.