AnyEvent-WebDriver
view release on metacpan or search on metacpan
Revision history for AnyEvent::WebDriver
TODO: investigate modifer key usage/special key usage in send_element_keys
TODO: geckodriver/chromedriver autostart classes
TODO: enforce duration values ot be integers
TODO: more move/source/duration examples
1.2 Sat Mar 28 18:05:59 CET 2020
- INCOMPATIBLE CHANGE: screenshots are now decoded and are no longer
in base64 (or data urls), but a biary png image.
- INCOMPAITBLE CHANGE: this module now uses the second key table
from the spec which contains shifted variants of the keys, which
allows for shifted characters and to distinguish between e.g.
left and right Alt keys, but causes some key names to change.
- docfix: ->move does not have a button argument.
- docfix: keyUp/keyDown are really key_up and key_down.
- ->move now truncates coordinates to integers.
- clarify documentation here and there.
- added untested print method from webdriver2 draft.
- parse the special keys at runtime, only when required, directly.
SCREEN CAPTURE
$wd->take_screenshot
Create a screenshot, returning it as a PNG image. To decode and
save, you could do something like:
use MIME::Base64 ();
my $screenshot = $wd->take_screenshot;
open my $fh, ">", "screenshot.png" or die "screenshot.png: $!\n";
syswrite $fh, MIME::Base64::decode_base64 $screenshot;
$wd->take_element_screenshot ($element)
Similar to "take_screenshot", but only takes a screenshot of the
bounding box of a single element.
Compatibility note: As of chrome version 80, I found that the
screenshot scaling is often wrong (the screenshot is much smaller
than the element normally displays) unless chrome runs in headless
WebDriver.pm view on Meta::CPAN
=item $wd->take_screenshot
Create a screenshot, returning it as a PNG image. To decode and save, you
could do something like:
use MIME::Base64 ();
my $screenshot = $wd->take_screenshot;
open my $fh, ">", "screenshot.png" or die "screenshot.png: $!\n";
syswrite $fh, MIME::Base64::decode_base64 $screenshot;
=item $wd->take_element_screenshot ($element)
Similar to C<take_screenshot>, but only takes a screenshot of the bounding
box of a single element.
Compatibility note: As of chrome version 80, I found that the screenshot
scaling is often wrong (the screenshot is much smaller than the element
( run in 2.225 seconds using v1.01-cache-2.11-cpan-df04353d9ac )