Raku Land

WebDriver

zef:raku-land

WebDriver

pipeline

WebDriver is a remote control interface for web browsers.

SYNOPSIS

use WebDriver;

my $wd = WebDriver.new :4444port;

# Go to Google.
$wd.get: 'https://www.google.com';

# Run a search for "raku".
$wd.find('input[name=q]').send-keys: 'raku';
$wd.find('input[value="Google Search"]').click;
 
# Click the first result.
$wd.find('h3').click;
 
# Save a screenshot of the page.
spurt 'screenshot.png', $wd.screenshot;

METHODS

Actions

find

method find(Str:D $value, Selector:D :$using = Selector::CSS) of Element

find-all

method find-all(Str:D $value, Selector:D :$using = Selector::CSS)

Alerts

accept-alert

method accept-alert of ::?CLASS

Accept an alert.

alert-text

multi method alert-text              of Str
multi method alert-text(Str:D $text) of ::?CLASS

Get or set the text of an alert.

dismiss-alert

method dismiss-alert of ::?CLASS

Dismiss an alert.

back

method back of ::?CLASS

forward

method forward of ::?CLASS

get

method get(Str:D $url) of ::?CLASS

refresh

method refresh of ::?CLASS

SEE ALSO

WebDriver Spec