AnyEvent-WebDriver
view release on metacpan or search on metacpan
ELEMENT INTERACTION
$wd->element_click ($element)
Clicks the given element.
$wd->element_clear ($element)
Clear the contents of the given element.
$wd->element_send_keys ($element, $text)
Sends the given text as key events to the given element. Key input
state can be cleared by embedding "\x{e000}" in $text. Presumably,
you can embed modifiers using their unicode codepoints, but the
specification is less than clear to mein this area.
DOCUMENT HANDLING
$source = $wd->get_page_source
Returns the (HTML/XML) page source of the current document.
$results = $wd->execute_script ($javascript, $args)
Synchronously execute the given script with given arguments and
return its results ($args can be "undef" if no arguments are
wanted/needed).
$al->key ("\x{e007}");
Example: press and release the "enter" key using the special key
name syntax:
$al->key ("{Enter}");
$al = $al->type ($string, $source)
Convenience method to simulate a series of key press and release
events for the keys in $string, one pair per extended unicode
grapheme cluster. There is no syntax for special keys, everything
will be typed "as-is" if possible.
$al->perform ($wd)
Finalises and compiles the list, if not done yet, and calls
"$wd->perform" with it.
If $wd is undef, and the action list was created using the
"$wd->actions" method, then perform it against that WebDriver
object.
WebDriver.pm view on Meta::CPAN
Clicks the given element.
=item $wd->element_clear ($element)
Clear the contents of the given element.
=item $wd->element_send_keys ($element, $text)
Sends the given text as key events to the given element. Key input state
can be cleared by embedding C<\x{e000}> in C<$text>. Presumably, you can
embed modifiers using their unicode codepoints, but the specification is
less than clear to mein this area.
=cut
sub element_click_ {
$_[0]->post_ ("element/$_[1]{$WEB_ELEMENT_IDENTIFIER}/click" => undef, $_[2]);
}
sub element_clear_ {
$_[0]->post_ ("element/$_[1]{$WEB_ELEMENT_IDENTIFIER}/clear" => undef, $_[2]);
WebDriver.pm view on Meta::CPAN
$al->key ("\x{e007}");
Example: press and release the "enter" key using the special key name syntax:
$al->key ("{Enter}");
=item $al = $al->type ($string, $source)
Convenience method to simulate a series of key press and release events
for the keys in C<$string>, one pair per extended unicode grapheme
cluster. There is no syntax for special keys, everything will be typed
"as-is" if possible.
=cut
# copy&paste from the spec via browser, with added MetaLeft/MetaRight aliases
our $SPECIAL_KEY = <<'EOF';
"`" "~" "Backquote"
"\" "|" "Backslash"
"\uE003" "Backspace"
( run in 0.240 second using v1.01-cache-2.11-cpan-88abd93f124 )