Branch Coverage

blib/lib/Selenium/Remote/Driver.pm
Criterion Covered Total %
branch 113 258 43.8


line true false branch
280 31 1 unless (defined $self->session_id)
281 5 26 if ($self->has_desired_capabilities) { }
290 0 30 if (not defined $self->session_id) { }
0 30 elsif ($self->has_inner_window_size) { }
299 0 30 if $self->debug
307 110 190 unless ($self->can($finder_name))
324 2 2 unless (exists $args{'desired_capabilities'})
333 0 38 if $$ != $self->pid
334 0 38 if $in_global_destruction
335 21 17 if $self->auto_close and defined $self->session_id
435 4 18 unless $FORCE_WD2
437 2 20 if (defined $self->proxy)
441 0 22 if ($args->{'desiredCapabilities'}{'browserName'} =~ /firefox/i and $self->has_firefox_profile)
473 2 134 if (exists $args->{'desiredCapabilities'}{'browserName'} and $cap eq "extra_capabilities")
477 1 1 if (exists $args->{'capabilities'}{'alwaysMatch'}{'moz:firefoxOptions'}{'args'})
487 1 1 if $args->{'desiredCapabilities'}{'browserName'} eq "firefox"
493 2 134 if (exists $args->{'desiredCapabilities'}{'browserName'} and $args->{'desiredCapabilities'}{'browserName'} eq "firefox" and $cap eq "firefox_profile")
497 1 1 if (ref $args->{'capabilities'}{'alwaysMatch'}{$cap} eq 'Selenium::Firefox::Profile') { }
516 103 369 if ($newkey eq $cap)
517 31 72 if $cmap->{$newkey} eq $cap
525 103 33 unless &any(sub { $_ eq $cap; } , @$caps)
528 0 29 if $FORCE_WD3
530 21 8 if $FORCE_WD2
533 0 27 if ($self->isa("Selenium::Firefox") or $self->isa("Selenium::Chrome") or $self->isa("Selenium::Edge"))
534 0 0 if (exists $args->{'capabilities'} and exists $args->{'capabilities'}{'alwaysMatch'})
544 0 29 if ($self->isa("Selenium::Chrome"))
545 0 0 if (exists $args->{'desiredCapabilities'})
565 0 28 if ($resp->{'cmd_status'} and $resp->{'cmd_status'} eq "NOT OK")
569 27 1 if (defined $resp->{'sessionId'} and $resp->{'sessionId'} ne '') { }
575 1 0 if (ref $resp->{'cmd_return'} eq 'HASH') { }
585 2 10 if (ref $resp->{'cmd_return'} eq "HASH" and $resp->{'cmd_return'}{'capabilities'})
594 1 11 if (ref $resp->{'cmd_return'} eq "HASH" and $resp->{'cmd_return'}{'chrome'})
595 0 1 if (defined $resp->{'cmd_return'}{'setWindowRect'})
604 0 12 if (ref $resp->{'cmd_return'} eq "HASH" and $resp->{'cmd_return'}{'pageLoadStrategy'} and $self->browser_name eq "MicrosoftEdge")
661 0 0 if ($self->{'is_wd3'} and not grep({$self->browser_name eq $_;} "MicrosoftEdge"))
735 0 0 if (ref $action{'actions'} eq "ARRAY")
739 0 0 if ($global_action->{'id'} eq $live_action->{'id'})
744 0 0 if ($existing_action) { }
768 0 0 if exists $params{'element'}
770 0 0 if ($self->{'is_wd3'} and not grep({$self->browser_name eq $_;} "MicrosoftEdge"))
781 0 0 if $origin
823 0 1 unless (defined $type)
827 0 0 if $type eq "page load" and $self->browser_name ne "MicrosoftEdge"
836 0 0 if ($self->browser_name eq "MicrosoftEdge")
847 0 1 if $self->{'is_wd3'}
858 0 3 if $self->{'is_wd3'}
905 0 0 defined $window ? :
908 0 0 if $self->{'is_wd3'}
915 0 0 defined $window ? :
918 0 0 if $self->{'is_wd3'}
939 5 23 if ($self->has_base_url and not $url =~ m[://])
986 2 0 if ($self->has_javascript) { }
987 0 2 unless (defined $script)
996 1 1 if (&Scalar::Util::blessed($args[$i]) and $args[$i]->isa("Selenium::Remote::WebElement"))
999 0 1 if ($self->{'is_wd3'}) { }
1014 2 0 if (ref $ret and ref $ret eq "HASH" and $self->_looks_like_element($ret))
1033 8 0 if ($self->has_javascript) { }
1034 0 8 unless (defined $script)
1043 1 1 if (&Scalar::Util::blessed($args[$i]) and $args[$i]->isa("Selenium::Remote::WebElement"))
1046 0 1 if ($self->{'is_wd3'}) { }
1086 3 6 if (ref $ret and ref $ret eq "HASH")
1087 3 0 if ($self->_looks_like_element($ret))
1103 1 5 if (ref $ret and ref $ret eq "ARRAY")
1116 0 0 if $params->{'full'} and $self->{'browser_name'} ne "firefox"
1118 0 0 $params->{'full'} == 1 ? :
1125 0 0 unless $filename
1150 1 0 defined $id ? :
1154 0 1 if (ref $id eq $self->webelement_class) { }
1155 0 0 if ($self->{'is_wd3'}) { }
1180 0 4 unless (defined $name)
1191 0 0 defined $window ? :
1192 0 0 unless (defined $x or defined $y)
1195 0 0 unless &Scalar::Util::looks_like_number($x)
1197 0 0 unless &Scalar::Util::looks_like_number($y)
1204 0 0 if ($self->{'is_wd3'})
1208 0 0 $ret ? :
1214 0 0 defined $window ? :
1215 0 0 unless (defined $height or defined $width)
1218 0 0 unless &Scalar::Util::looks_like_number($height)
1220 0 0 unless &Scalar::Util::looks_like_number($width)
1227 0 0 if ($self->{'is_wd3'})
1231 0 0 $ret ? :
1238 0 0 defined $window ? :
1241 0 0 $ret ? :
1247 0 0 defined $window ? :
1250 0 0 $ret ? :
1256 0 0 defined $window ? :
1259 0 0 $ret ? :
1274 0 1 unless (defined $name and defined $value)
1283 0 1 defined $secure && $secure ? :
1293 1 0 if $domain
1294 0 1 if $httponly
1295 0 1 if $expiry
1317 0 1 unless (defined $cookie_name)
1334 0 67 unless (defined $query)
1341 12 55 if ($@)
1342 11 1 if ($@ =~ /(An element could not be located on the page using the given search parameters)/) { }
1365 0 6 unless (defined $query)
1372 0 6 if ($@)
1373 0 0 if ($@ =~ /(An element could not be located on the page using the given search parameters)/) { }
1397 1 3 wantarray ? :
1403 1 3 unless (defined $elem and defined $query)
1409 0 3 if ($@)
1410 0 0 if ($@ =~ /(An element could not be located on the page using the given search parameters)/) { }
1433 0 2 unless (defined $elem and defined $query)
1440 0 2 if ($@)
1441 0 0 if ($@ =~ /(An element could not be located on the page using the given search parameters)/) { }
1464 0 2 wantarray ? :
1474 0 78 if ($self->isa('Selenium::Firefox') and $using eq 'name') { }
1491 69 9 if ($method) { }
1492 69 0 if ($self->FINDERS->{$method}) { }
1510 0 1 if ($@) { }
1573 1 0 if ($isdown =~ /(down|up)/)
1574 1 0 $isdown =~ /down/ ? :
1577 0 1 if ($self->{'is_wd3'} and not grep({$self->browser_name eq $_;} "MicrosoftEdge"))
1583 0 0 $isdown ? :
1627 0 0 if ($self->{'is_wd3'} and not grep({$self->browser_name eq $_;} "MicrosoftEdge"))
1651 0 0 if ($append)
1664 0 0 if (defined $button and $button =~ /(LEFT|MIDDLE|RIGHT)/i)
1667 0 0 if (defined $button and $button =~ /(0|1|2)/)
1680 0 0 if ($self->{'is_wd3'} and not grep({$self->browser_name eq $_;} "MicrosoftEdge"))
1696 0 0 if ($self->{'is_wd3'} and not grep({$self->browser_name eq $_;} "MicrosoftEdge"))
1727 0 0 if ($self->{'is_wd3'} and not grep({$self->browser_name eq $_;} "MicrosoftEdge"))
1762 1 4 if (defined $raw_content) { }
1781 1 3 unless (-r $filename)
1785 0 3 if ($zip->writeToFileHandle("IO::String"->new($string)) != 0)
1838 0 0 $self->execute_script(join(';', @resize)) ? :
1860 6 1 if (defined $ms) { }
1871 2 5 if (&Scalar::Util::looks_like_number($maybe_number)) { }