File Coverage

blib/lib/Selenium/Remote/Finders.pm
Criterion Covered Total %
statement 26 26 100.0
branch n/a
condition n/a
subroutine 10 10 100.0
pod n/a
total 36 36 100.0


line stmt bran cond sub pod time code
1             package Selenium::Remote::Finders;
2             $Selenium::Remote::Finders::VERSION = '1.48';
3 14     14   9115 use strict;
  14         40  
  14         443  
4 14     14   82 use warnings;
  14         32  
  14         501  
5              
6             # ABSTRACT: Handle construction of generic parameter finders
7 14     14   83 use Try::Tiny;
  14         64  
  14         970  
8 14     14   101 use Carp qw/carp/;
  14         45  
  14         697  
9 14     14   105 use Moo::Role;
  14         39  
  14         150  
10 14     14   9759 use namespace::clean;
  14         71527  
  14         164  
11              
12              
13             sub _build_find_by {
14 110     110   283 my ( $self, $by ) = @_;
15              
16             return sub {
17 20     20   17382 my ( $driver, $locator ) = @_;
18 20         46 my $strategy = $by;
19              
20             return try {
21 20     20   1019 return $driver->find_element( $locator, $strategy );
22             }
23             catch {
24 10     10   1277 carp $_;
25 10         472 return 0;
26 20         129 };
27             }
28 110         834 }
29              
30             1;
31              
32             __END__