Weasel::FindExpanders(3pm) | User Contributed Perl Documentation | Weasel::FindExpanders(3pm) |
NAME¶
Weasel::FindExpanders - Mapping find patterns to xpath locatorsVERSION¶
0.01SYNOPSIS¶
use Weasel::FindExpanders qw( register_find_expander ); register_find_expander( 'button', 'HTML', sub { my %args = @_; $args{text} =~ s/'/''/g; # quote the quotes (XPath 2.0) return ".//button[text()='$args{text}']"; }); $session->find($session->page, "@button|{text=>\"whatever\"}");
DESCRIPTION¶
DEPENDENCIES¶
SUBROUTINES/METHODS¶
- register_find_expander($pattern_name, $group_name, &expander_function)
- Registers &expander_function as an expander
for $pattern_name in
$group_name.
"Weasel::Session" selects the expanders to be applied using its "groups" attribute.
- expand_finder_pattern($pattern, $args, $groups)
- Returns a string of concatenated (using xpath '|' operator) expansions.
When $groups is undef, all groups will be searched for "pattern_name".
If the pattern doesn't match '*<pattern_name>|{<arguments>}', the pattern is returned as the only list/arrayref element.
AUTHOR¶
Erik HuelsmannCONTRIBUTORS¶
Erik Huelsmann Yves LavoieMAINTAINERS¶
Erik HuelsmannBUGS AND LIMITATIONS¶
Bugs can be filed in the GitHub issue tracker for the Weasel project: https://github.com/perl-weasel/weasel/issuesSOURCE¶
The source code repository for Weasel is at https://github.com/perl-weasel/weaselSUPPORT¶
Community support is available through perl-weasel@googlegroups.com <mailto:perl-weasel@googlegroups.com>.LICENSE AND COPYRIGHT¶
(C) 2016 Erik Huelsmann
Licensed under the same terms as Perl.
2019-02-21 | perl v5.28.1 |