WebElement Class
An object representing an element inside the DOM
Item Index
Methods
attr
-
attributeName
Get the value of an element's attribute.
Parameters:
-
attributeName
StringAttribute name
Returns:
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
Query the value of an element's computed CSS property.
Parameters:
-
propertyName
StringCSS 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:
equals
-
other
Test if the elements refer to the same DOM element.
Parameters:
-
other
WebElementThe other element to match with
Returns:
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:
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:
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.