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")
511 103 364 if ($newkey eq $cap)
512 31 72 if $cmap->{$newkey} eq $cap
520 103 33 unless &any(sub { $_ eq $cap; } , @$caps)
523 0 29 if $FORCE_WD3
525 21 8 if $FORCE_WD2
528 0 27 if ($self->isa("Selenium::Firefox") or $self->isa("Selenium::Chrome") or $self->isa("Selenium::Edge"))
529 0 0 if (exists $args->{'capabilities'} and exists $args->{'capabilities'}{'alwaysMatch'})
539 0 29 if ($self->isa("Selenium::Chrome"))
540 0 0 if (exists $args->{'desiredCapabilities'})
560 0 28 if ($resp->{'cmd_status'} and $resp->{'cmd_status'} eq "NOT OK")
564 27 1 if (defined $resp->{'sessionId'} and $resp->{'sessionId'} ne '') { }
570 1 0 if (ref $resp->{'cmd_return'} eq 'HASH') { }
580 2 10 if (ref $resp->{'cmd_return'} eq "HASH" and $resp->{'cmd_return'}{'capabilities'})
589 1 11 if (ref $resp->{'cmd_return'} eq "HASH" and $resp->{'cmd_return'}{'chrome'})
590 0 1 if (defined $resp->{'cmd_return'}{'setWindowRect'})
599 0 12 if (ref $resp->{'cmd_return'} eq "HASH" and $resp->{'cmd_return'}{'pageLoadStrategy'} and $self->browser_name eq "MicrosoftEdge")
656 0 0 if ($self->{'is_wd3'} and not grep({$self->browser_name eq $_;} "MicrosoftEdge"))
730 0 0 if (ref $action{'actions'} eq "ARRAY")
734 0 0 if ($global_action->{'id'} eq $live_action->{'id'})
739 0 0 if ($existing_action) { }
763 0 0 if exists $params{'element'}
765 0 0 if ($self->{'is_wd3'} and not grep({$self->browser_name eq $_;} "MicrosoftEdge"))
776 0 0 if $origin
818 0 1 unless (defined $type)
822 0 0 if $type eq "page load" and $self->browser_name ne "MicrosoftEdge"
831 0 0 if ($self->browser_name eq "MicrosoftEdge")
842 0 1 if $self->{'is_wd3'}
853 0 3 if $self->{'is_wd3'}
900 0 0 defined $window ? :
903 0 0 if $self->{'is_wd3'}
910 0 0 defined $window ? :
913 0 0 if $self->{'is_wd3'}
934 5 23 if ($self->has_base_url and not $url =~ m[://])
981 2 0 if ($self->has_javascript) { }
982 0 2 unless (defined $script)
991 1 1 if (&Scalar::Util::blessed($args[$i]) and $args[$i]->isa("Selenium::Remote::WebElement"))
994 0 1 if ($self->{'is_wd3'}) { }
1009 2 0 if (ref $ret and ref $ret eq "HASH" and $self->_looks_like_element($ret))
1028 8 0 if ($self->has_javascript) { }
1029 0 8 unless (defined $script)
1038 1 1 if (&Scalar::Util::blessed($args[$i]) and $args[$i]->isa("Selenium::Remote::WebElement"))
1041 0 1 if ($self->{'is_wd3'}) { }
1081 3 6 if (ref $ret and ref $ret eq "HASH")
1082 3 0 if ($self->_looks_like_element($ret))
1098 1 5 if (ref $ret and ref $ret eq "ARRAY")
1111 0 0 if $params->{'full'} and $self->{'browser_name'} ne "firefox"
1113 0 0 $params->{'full'} == 1 ? :
1120 0 0 unless $filename
1145 1 0 defined $id ? :
1149 0 1 if (ref $id eq $self->webelement_class) { }
1150 0 0 if ($self->{'is_wd3'}) { }
1175 0 4 unless (defined $name)
1186 0 0 defined $window ? :
1187 0 0 unless (defined $x or defined $y)
1190 0 0 unless &Scalar::Util::looks_like_number($x)
1192 0 0 unless &Scalar::Util::looks_like_number($y)
1199 0 0 if ($self->{'is_wd3'})
1203 0 0 $ret ? :
1209 0 0 defined $window ? :
1210 0 0 unless (defined $height or defined $width)
1213 0 0 unless &Scalar::Util::looks_like_number($height)
1215 0 0 unless &Scalar::Util::looks_like_number($width)
1222 0 0 if ($self->{'is_wd3'})
1226 0 0 $ret ? :
1233 0 0 defined $window ? :
1236 0 0 $ret ? :
1242 0 0 defined $window ? :
1245 0 0 $ret ? :
1251 0 0 defined $window ? :
1254 0 0 $ret ? :
1269 0 1 unless (defined $name and defined $value)
1278 0 1 defined $secure && $secure ? :
1288 1 0 if $domain
1289 0 1 if $httponly
1290 0 1 if $expiry
1312 0 1 unless (defined $cookie_name)
1329 0 67 unless (defined $query)
1336 12 55 if ($@)
1337 11 1 if ($@ =~ /(An element could not be located on the page using the given search parameters)/) { }
1360 0 6 unless (defined $query)
1367 0 6 if ($@)
1368 0 0 if ($@ =~ /(An element could not be located on the page using the given search parameters)/) { }
1392 1 3 wantarray ? :
1398 1 3 unless (defined $elem and defined $query)
1404 0 3 if ($@)
1405 0 0 if ($@ =~ /(An element could not be located on the page using the given search parameters)/) { }
1428 0 2 unless (defined $elem and defined $query)
1435 0 2 if ($@)
1436 0 0 if ($@ =~ /(An element could not be located on the page using the given search parameters)/) { }
1459 0 2 wantarray ? :
1469 0 78 if ($self->isa('Selenium::Firefox') and $using eq 'name') { }
1486 69 9 if ($method) { }
1487 69 0 if ($self->FINDERS->{$method}) { }
1505 0 1 if ($@) { }
1568 1 0 if ($isdown =~ /(down|up)/)
1569 1 0 $isdown =~ /down/ ? :
1572 0 1 if ($self->{'is_wd3'} and not grep({$self->browser_name eq $_;} "MicrosoftEdge"))
1578 0 0 $isdown ? :
1622 0 0 if ($self->{'is_wd3'} and not grep({$self->browser_name eq $_;} "MicrosoftEdge"))
1646 0 0 if ($append)
1659 0 0 if (defined $button and $button =~ /(LEFT|MIDDLE|RIGHT)/i)
1662 0 0 if (defined $button and $button =~ /(0|1|2)/)
1675 0 0 if ($self->{'is_wd3'} and not grep({$self->browser_name eq $_;} "MicrosoftEdge"))
1691 0 0 if ($self->{'is_wd3'} and not grep({$self->browser_name eq $_;} "MicrosoftEdge"))
1722 0 0 if ($self->{'is_wd3'} and not grep({$self->browser_name eq $_;} "MicrosoftEdge"))
1757 1 4 if (defined $raw_content) { }
1776 1 3 unless (-r $filename)
1780 0 3 if ($zip->writeToFileHandle("IO::String"->new($string)) != 0)
1833 0 0 $self->execute_script(join(';', @resize)) ? :
1855 6 1 if (defined $ms) { }
1866 2 5 if (&Scalar::Util::looks_like_number($maybe_number)) { }