Wrapper object of all found elements. This list mimics the behaviour of Element
by exposing similar methods. The call of these methods gets delegated to first element.
By default, the ElementWrapper acts as a proxy to the first matching element and hence
it forwards function calls that belong to Element
API documentation for get.
Name Type Description retryIntervalnumber Retry Interval in milliseconds (defaults to global settings). retryTimeoutnumber Retry Timeout in milliseconds (defaults to global settings).
Type Description Array <Element >All elements mathing the selector.
Describes the operation performed. The description is the same that is printed when performing the operation in REPL.
link ( ' google ' ) . description // prints "'Link with text google'"
This API does not have any parameters.
Type Description string Description of the current command that fetched this element(wrapper).
Checks existence for element. exists() waits for retryTimeout before deciding that the page is loaded.
(NOTE: exists() returns boolean from version 0.4.0)
// To 'short-circuit' non existence. However this should be done only if there is no network calls/reloads.
link ( ' google ' ) . exists ( 1000 )
Name Type Description retryIntervalnumber Retry Interval in milliseconds (defaults to global settings). retryTimeoutnumber Retry Timeout in milliseconds (defaults to global settings).
Type Description boolean true if exists, else false.
Gets the innerText of the element
This API does not have any parameters.
Checks if element is visually visible. isVisible() is false when the element is overshadowed by another element,
or if the element is outside the viewport.
Name Type Description retryIntervalnumber Retry Interval in milliseconds (defaults to global settings). retryTimeoutnumber Retry Timeout in milliseconds (defaults to global settings).
Type Description boolean true if visible, else false.
Checks if element is disabled
Name Type Description retryIntervalnumber Retry Interval in milliseconds (defaults to global settings). retryTimeoutnumber Retry Timeout in milliseconds (defaults to global settings).
Type Description boolean true if disabled, else false.
Checks if element is draggable .
Name Type Description retryIntervalnumber Retry Interval in milliseconds (defaults to global settings). retryTimeoutnumber Retry Timeout in milliseconds (defaults to global settings).
Type Description boolean true if disabled, else false.
Read attribute value of the element found.
link ( ' google ' ) . attribute ( ' alt ' )
Type Description string value of attribute
DOM element getter. Implicitly wait for the element to appears with timeout of 10 seconds.
// To loop over all the elements
let elements = await $ ( ' a ' ) . elements ();
for ( element of elements ) {
console . log ( await element . text ());
textBox ( ' username ' ) . value ()
( await textBox ( ' username ' ) . elements ())[ 0 ] . value () # same as above
( await $ ( ' .class ' ) . elements ())[ 0 ] . text () # same as above
let element = await $ ( ' a ' ) . element ( 0 );
console . log ( await element . text ());
Name Type Description retryIntervalnumber Retry Interval in milliseconds (defaults to global settings). retryTimeoutnumber Retry Timeout in milliseconds (defaults to global settings).
Type Description Array <Element >Array of all elements matching the selector.
DOM element getter. Implicitly wait for the element to appears with timeout of 10 seconds.
Name Type Description indexnumber Zero-based index of element to return retryIntervalnumber Retry Interval in milliseconds (defaults to global settings). retryTimeoutnumber Retry Timeout in milliseconds (defaults to global settings).
Type Description Element First element that matches the selector.