| 1 | package Selenium::Remote::Finders; | ||
| 2 | 27 | $Selenium::Remote::Finders::VERSION = '1.49'; | |
| 3 | 27 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 27 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | # ABSTRACT: Handle construction of generic parameter finders | ||
| 7 | 27 | ▶ | use Try::Tiny; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 27 | ▶ | use Carp qw/carp/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 27 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 27 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | |||
| 13 | sub _build_find_by { | ||
| 14 | 110 | ▶ | my ( $self, $by ) = @_; |
|
Subroutine
_build_find_by: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | return sub { | ||
| 17 | 20 | ▶ | my ( $driver, $locator ) = @_; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 18 | 20 | my $strategy = $by; | |
| 19 | |||
| 20 | return try { | ||
| 21 | 20 | ▶ | return $driver->find_element( $locator, $strategy ); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 22 | } | ||
| 23 | catch { | ||
| 24 | 10 | ▶ | carp $_; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 25 | 10 | return 0; | |
| 26 | 20 | }; | |
| 27 | } | ||
| 28 | 110 | } | |
| 29 | |||
| 30 | 27 | 1; | |
| 31 | |||
| 32 | __END__ | ||
| 33 | |||
| 34 | =pod | ||
| 35 | |||
| 36 | =encoding UTF-8 | ||
| 37 | |||
| 38 | =head1 NAME | ||
| 39 | |||
| 40 | Selenium::Remote::Finders - Handle construction of generic parameter finders | ||
| 41 | |||
| 42 | =head1 VERSION | ||
| 43 | |||
| 44 | version 1.49 | ||
| 45 | |||
| 46 | =head1 DESCRIPTION | ||
| 47 | |||
| 48 | This package just takes care of setting up parameter finders - that | ||
| 49 | is, the C<find_element_by_.*> versions of the find element | ||
| 50 | functions. You probably don't need to do anything with this package; | ||
| 51 | instead, see L<Selenium::Remote::Driver/find_element> documentation | ||
| 52 | for the specific finder functions. | ||
| 53 | |||
| 54 | =head1 AUTHORS | ||
| 55 | |||
| 56 | Current Maintainers: | ||
| 57 | |||
| 58 | =over 4 | ||
| 59 | |||
| 60 | =item * | ||
| 61 | |||
| 62 | George S. Baugh <george@troglodyne.net> | ||
| 63 | |||
| 64 | =back | ||
| 65 | |||
| 66 | Previous maintainers: | ||
| 67 | |||
| 68 | =over 4 | ||
| 69 | |||
| 70 | =item * | ||
| 71 | |||
| 72 | Daniel Gempesaw <gempesaw@gmail.com> | ||
| 73 | |||
| 74 | =item * | ||
| 75 | |||
| 76 | Emmanuel Peroumalnaïk <peroumalnaik.emmanuel@gmail.com> | ||
| 77 | |||
| 78 | =item * | ||
| 79 | |||
| 80 | Luke Closs <cpan@5thplane.com> | ||
| 81 | |||
| 82 | =item * | ||
| 83 | |||
| 84 | Mark Stosberg <mark@stosberg.com> | ||
| 85 | |||
| 86 | =back | ||
| 87 | |||
| 88 | Original authors: | ||
| 89 | |||
| 90 | =over 4 | ||
| 91 | |||
| 92 | =item * | ||
| 93 | |||
| 94 | Aditya Ivaturi <ivaturi@gmail.com> | ||
| 95 | |||
| 96 | =back | ||
| 97 | |||
| 98 | =head1 COPYRIGHT AND LICENSE | ||
| 99 | |||
| 100 | Copyright (c) 2010-2011 Aditya Ivaturi, Gordon Child | ||
| 101 | |||
| 102 | Copyright (c) 2014-2017 Daniel Gempesaw | ||
| 103 | |||
| 104 | Copyright (c) 2018-2021 George S. Baugh | ||
| 105 | |||
| 106 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 107 | you may not use this file except in compliance with the License. | ||
| 108 | You may obtain a copy of the License at | ||
| 109 | |||
| 110 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 111 | |||
| 112 | Unless required by applicable law or agreed to in writing, software | ||
| 113 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 114 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 115 | See the License for the specific language governing permissions and | ||
| 116 | limitations under the License. | ||
| 117 | |||
| 118 | =cut | ||