++ed by:

2 non-PAUSE users.

CV-Library Ltd.
and 1 contributors

NAME

WebDriver::Tiny::Elements

METHODS

Actions

click

 $elems->click;

clear

 $elems->clear;

send_keys

 $elems->send_keys('The quick brown fox jumps over the lazy dog');

submit

tap

Attributes

attr

css

enabled

html

 say $elem->html;

Get a serialized HTML fragment describing the element including its descendants.

location

Get an element's location on the page.

Accepts no arguments. Returns a hashref containing x and y.

location_in_view

Get an element's location on the screen once it has been scrolled into view.

Accepts no arguments. Returns a hashref containing x and y.

rect

selected

tag

text

Get the combined text contents of each element in the set of matched elements, including their descendants.

visible

Manipulation

The following methods merely return information about this collection or return a new collection, none of them involve a call to the server.

append

Returns a new collection containing all the elements in the original plus any that were passed as arguments.

first

Returns a new collection containing only the first element in this collection.

last

Returns a new collection containing only the last element in this collection.

size

Returns a count of how many elements are in the collection.

slice

Returns a new collection containing the elements of the current collection, indentified by indices, starting at zero e.g.

 $elems->slice(0);       # Same as first.
 $elems->slice(1, 2);    # The second and the third elements.
 $elems->slice(-1);      # Same as last.

split

Splits a collection into a list of collections, with each collection containing one element.

 @elems = $elems->split;

 $elems->split == $elems->size;  # true

uniq

Returns a new collection containing no duplicate elements, order is not preserved.

Other

find

screenshot my $png_blob = $elem->screenshot;

 $elem->screenshot('/tmp/foo.png');

SEE ALSO

WebDriver::Tiny