Weasel::DriverRole(3pm) | User Contributed Perl Documentation | Weasel::DriverRole(3pm) |
Weasel::DriverRole - API definition for driver wrappers
0.04
use Moose; use Weasel::DriverRole; with 'Weasel::DriverRole'; ... # (re)implement the functions in Weasel::DriverRole
This module defines the API for all Weasel drivers to be implemented.
By using this role in the driver implementation module, an abstract method is implemented croak()ing if it's called.
The value managed by the "start" and "stop" methods.
Weasel::Session may carp (warn) the user about mismatching API levels in case a driver is coded against an earlier version than $Weasel::DriverRole::VERSION.
Terms
Note: The driver should always accept an xpath locator as an
id value
as well as id values returned from earlier driver calls
API
Depending on array or scalar context, the return value is a list or an arrayref.
Note: there's no function to find a single element. That function is implemented on the "Weasel::Session" level.
The $url passed in has been expanded by "Weasel::Session", prepending a registered prefix.
Since 0.03: Unless an "on_timeout" callback is provided, will "die" when the timeout has exceeded. Otherwise, call the provided callback.
Note: The user should catch inside the callback any exceptions
that are
thrown inside the callback, unless such exceptions are allowed to
terminate further polling attempts.
I.e. this function doesn't guard against early termination by
catching exceptions.
Changes the value of the attribute named by $attribute_name to $value for the element identified by $element_id.
Please use "$self-"get_attribute('selected')> instead.
Please use "$self-"set_attribute('selected', $value)> instead.
Note: In the current version of the driver, it's assumed the
driver writes a PNG image. Later versions may add APIs to
get/set the type of image generated.
@keys is an array of (groups of) inputs; multiple multi-character strings may be listed. In such cases the input will be appended. E.g.
$driver->send_keys($element_id, "hello", ' ', "world");
is valid input to enter the text "hello world" into $element_id.
Note: Special keys are encoded according to the WebDriver
spec.
In case a driver implementation needs differentt encoding of
special keys, this function should recode from the values
found in WebDriver::KEYS() to the desired code-set
Weasel
Erik Huelsmann
Erik Huelsmann Yves Lavoie
Erik Huelsmann
Bugs can be filed in the GitHub issue tracker for the Weasel
project:
https://github.com/perl-weasel/weasel/issues
Please note that version 0.04 didn't have any functional changes; the version number increase served simply to split out the driver role into a separate dist.
The source code repository for Weasel is at
https://github.com/perl-weasel/weasel
Community support is available through perl-weasel@googlegroups.com <mailto:perl-weasel@googlegroups.com>.
(C) 2016-2019 Erik Huelsmann
Licensed under the same terms as Perl.
2021-01-10 | perl v5.32.0 |