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.29 by root, Sat Sep 1 01:39:17 2018 UTC vs.
Revision 1.30 by root, Sat Sep 1 04:21:00 2018 UTC

15 15
16 # create a new session with default capabilities. 16 # create a new session with default capabilities.
17 $wd->new_session ({}); 17 $wd->new_session ({});
18 18
19 $wd->navigate_to ("https://duckduckgo.com/html"); 19 $wd->navigate_to ("https://duckduckgo.com/html");
20 my $searchbox = $wd->find_element ("css selector" => 'input[type="text"]'); 20 my $searchbox = $wd->find_element (css => 'input[type="text"]');
21 21
22 $wd->element_send_keys ($searchbox => "free software"); 22 $wd->element_send_keys ($searchbox => "free software");
23 $wd->element_click ($wd->find_element ("css selector" => 'input[type="submit"]')); 23 $wd->element_click ($wd->find_element (css => 'input[type="submit"]'));
24 24
25 # session gets autodeleted by default, so wait a bit 25 # session gets autodeleted by default, so wait a bit
26 sleep 10; 26 sleep 10;
27
28 # this is an example of an action sequence
29 $wd->actions
30 ->move ($wd->find_element (...), 40, 5)
31 ->click
32 ->pause # to separate the click from the keypress
33 ->type ("some text")
34 ->key ("{Enter}")
35 ->perform;
27 36
28=head1 DESCRIPTION 37=head1 DESCRIPTION
29 38
30WARNING: THE API IS NOT GUARANTEED TO BE STABLE UNTIL VERSION 1.0. 39WARNING: THE API IS NOT GUARANTEED TO BE STABLE UNTIL VERSION 1.0.
31 40
35 44
36At the time of this writing, it was so brand new that I could only get 45At the time of this writing, it was so brand new that I could only get
37C<geckodriver> (For Firefox) to work, but that is expected to be fixed 46C<geckodriver> (For Firefox) to work, but that is expected to be fixed
38very soon indeed. 47very soon indeed.
39 48
49One of the design goals of this module was to stay very close to the
50language and words used in the WebDriver specification itself, so to make
40To make most of this module, or, in fact, to make any reasonable use of 51most of this module, or, in fact, to make any reasonable use of this
41this module, you would need to refer to the W3C WebDriver recommendation, 52module, you would need to refer to the W3C WebDriver recommendation, which
42which can be found L<here|https://www.w3.org/TR/webdriver1/>: 53can be found L<here|https://www.w3.org/TR/webdriver1/>:
43 54
44 https://www.w3.org/TR/webdriver1/ 55 https://www.w3.org/TR/webdriver1/
45 56
46=head2 CONVENTIONS 57=head2 CONVENTIONS
47 58

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines