… | |
… | |
47 | |
47 | |
48 | https://www.w3.org/TR/webdriver1/ |
48 | https://www.w3.org/TR/webdriver1/ |
49 | |
49 | |
50 | Mozilla's "geckodriver" has had webdriver for a long time, while |
50 | Mozilla's "geckodriver" has had webdriver for a long time, while |
51 | "chromedriver" only has basic and mostly undocumented webdriver support |
51 | "chromedriver" only has basic and mostly undocumented webdriver support |
52 | since release 77. |
52 | as of release 77. |
53 | |
|
|
54 | In debian GNU/Linux, you can install the "firefoxdriver" or |
|
|
55 | "chromium-driver" packages to get the firefox/chromium webdrivers, |
|
|
56 | respectively. |
|
|
57 | |
53 | |
58 | CONVENTIONS |
54 | CONVENTIONS |
59 | Unless otherwise stated, all delays and time differences in this module |
55 | Unless otherwise stated, all delays and time differences in this module |
60 | are represented as an integer number of milliseconds. |
56 | are represented as an integer number of milliseconds. |
61 | |
57 | |
… | |
… | |
79 | variable), specify a value of "default". |
75 | variable), specify a value of "default". |
80 | |
76 | |
81 | autodelete => $boolean |
77 | autodelete => $boolean |
82 | If true (the default), then automatically execute |
78 | If true (the default), then automatically execute |
83 | "delete_session" when the WebDriver object is destroyed with an |
79 | "delete_session" when the WebDriver object is destroyed with an |
84 | active session. IF set to a false value, then the session will |
80 | active session. If set to a false value, then the session will |
85 | continue to exist. |
81 | continue to exist. |
86 | |
82 | |
|
|
83 | Note that due to bugs in perl that are unlikely to get fixed, |
|
|
84 | "autodelete" is likely ineffective during global destruction and |
|
|
85 | might even crash your process, so you should ensure objects go |
|
|
86 | out of scope before that, or explicitly call "delete_session", |
|
|
87 | if you want the session to be cleaned up. |
|
|
88 | |
87 | timeout => $seconds |
89 | timeout => $seconds |
88 | The HTTP timeout, in (fractional) seconds (default: 300, but |
90 | The HTTP timeout, in (fractional) seconds (default: 300). This |
89 | this will likely drastically reduce). This timeout is reset on |
91 | timeout is reset on any activity, so it is not an overall |
90 | any activity, so it is not an overall request timeout. Also, |
92 | request timeout. Also, individual requests might extend this |
91 | individual requests might extend this timeout if they are known |
93 | timeout if they are known to take longer. |
92 | to take longer. |
|
|
93 | |
94 | |
94 | persistent => 1 | "undef" |
95 | persistent => 1 | "undef" |
95 | If true (the default) then persistent connections will be used |
96 | If true (the default) then persistent connections will be used |
96 | for all requests, which assumes you have a reasonably stable |
97 | for all requests, which assumes you have a reasonably stable |
97 | connection (such as to "localhost" :) and that the WebDriver has |
98 | connection (such as to "localhost" :) and that the WebDriver has |
… | |
… | |
206 | Firefox-specific capability documentation can be found on MDN |
207 | Firefox-specific capability documentation can be found on MDN |
207 | <https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities |
208 | <https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities |
208 | >, Chrome-specific capability documentation might be found here |
209 | >, Chrome-specific capability documentation might be found here |
209 | <http://chromedriver.chromium.org/capabilities>, but the latest |
210 | <http://chromedriver.chromium.org/capabilities>, but the latest |
210 | release at the time of this writing (chromedriver 77) has |
211 | release at the time of this writing (chromedriver 77) has |
211 | essentially no webdriver documentation about chrome capabilities. |
212 | essentially no documentation about webdriver capabilities (even MDN |
|
|
213 | has better documentation about chromwedriver!) |
212 | |
214 | |
213 | If you have URLs for Safari/IE/Edge etc. capabilities, feel free to |
215 | If you have URLs for Safari/IE/Edge etc. capabilities, feel free to |
214 | tell me about them. |
216 | tell me about them. |
215 | |
217 | |
216 | $wd->delete_session |
218 | $wd->delete_session |
217 | Deletes the session - the WebDriver object must not be used after |
219 | Deletes the session - the WebDriver object must not be used after |
218 | this call. |
220 | this call (except for calling this method). |
|
|
221 | |
|
|
222 | This method is always safe to call and will not do anything if there |
|
|
223 | is no active session. |
219 | |
224 | |
220 | $timeouts = $wd->get_timeouts |
225 | $timeouts = $wd->get_timeouts |
221 | Get the current timeouts, e.g.: |
226 | Get the current timeouts, e.g.: |
222 | |
227 | |
223 | my $timeouts = $wd->get_timeouts; |
228 | my $timeouts = $wd->get_timeouts; |
… | |
… | |
657 | |
662 | |
658 | Since building large action lists can take nontrivial amounts of |
663 | Since building large action lists can take nontrivial amounts of |
659 | time, it can make sense to build an action list only once and then |
664 | time, it can make sense to build an action list only once and then |
660 | perform it multiple times. |
665 | perform it multiple times. |
661 | |
666 | |
662 | Actions must not be added after compiling a list. |
667 | No additional actions must be added after compiling an action list. |
663 | |
668 | |
664 | EVENT BASED API |
669 | EVENT BASED API |
665 | This module wouldn't be a good AnyEvent citizen if it didn't have a true |
670 | This module wouldn't be a good AnyEvent citizen if it didn't have a true |
666 | event-based API. |
671 | event-based API. |
667 | |
672 | |