ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-WebDriver/WebDriver.pm
(Generate patch)

Comparing AnyEvent-WebDriver/WebDriver.pm (file contents):
Revision 1.5 by root, Tue Aug 28 23:10:30 2018 UTC vs.
Revision 1.6 by root, Tue Aug 28 23:11:12 2018 UTC

484 $element = $wd->find_element ("css selector" => "body a"); 484 $element = $wd->find_element ("css selector" => "body a");
485 $element = $wd->find_element ("link text" => "Click Here For Porn"); 485 $element = $wd->find_element ("link text" => "Click Here For Porn");
486 $element = $wd->find_element ("partial link text" => "orn"); 486 $element = $wd->find_element ("partial link text" => "orn");
487 $element = $wd->find_element ("tag name" => "input"); 487 $element = $wd->find_element ("tag name" => "input");
488 $element = $wd->find_element ("xpath" => '//input[@type="text"]'); 488 $element = $wd->find_element ("xpath" => '//input[@type="text"]');
489 # "decddca8-5986-4e1d-8c93-efe952505a5f" 489 => e.g. "decddca8-5986-4e1d-8c93-efe952505a5f"
490 490
491=item $element_ids = $wd->find_elements ($location_strategy, $selector) 491=item $element_ids = $wd->find_elements ($location_strategy, $selector)
492 492
493As above, but returns an arrayref of all found element IDs. 493As above, but returns an arrayref of all found element IDs.
494 494
1014Example: call C<find_elements> to find all C<IMG> elements, stripping the 1014Example: call C<find_elements> to find all C<IMG> elements, stripping the
1015returned element objects to only return the element ID strings: 1015returned element objects to only return the element ID strings:
1016 1016
1017 my $elems = $wd->post (elements => { using => "css selector", value => "img" }); 1017 my $elems = $wd->post (elements => { using => "css selector", value => "img" });
1018 1018
1019 # yes, the W3C found an interetsing way around the typelessness of JSON 1019 # yes, the W3C found an interesting way around the typelessness of JSON
1020 $_ = $_->{"element-6066-11e4-a52e-4f735466cecf"} 1020 $_ = $_->{"element-6066-11e4-a52e-4f735466cecf"}
1021 for @$elems; 1021 for @$elems;
1022 1022
1023=cut 1023=cut
1024 1024

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines