"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Kernel/cpan-lib/Selenium/Remote/Driver.pm" between
otrs-5.0.39.tar.bz2 and otrs-5.0.40.tar.bz2

About: OTRS (formerly "Open Ticket Request System" now "Open Technology – Real Service") is a web-based ticketing systems used for Customer Service, Help Desk, IT Service Management. 5.x release ("Community Edition").

Driver.pm  (otrs-5.0.39.tar.bz2):Driver.pm  (otrs-5.0.40.tar.bz2)
package Selenium::Remote::Driver; package Selenium::Remote::Driver;
$Selenium::Remote::Driver::VERSION = '1.33'; $Selenium::Remote::Driver::VERSION = '1.36';
use strict; use strict;
use warnings; use warnings;
# ABSTRACT: Perl Client for Selenium Remote Driver # ABSTRACT: Perl Client for Selenium Remote Driver
use Moo; use Moo;
use Try::Tiny; use Try::Tiny;
use 5.006; use 5.006;
use v5.10.0; # Before 5.006, v5.10.0 would not be understood. use v5.10.0; # Before 5.006, v5.10.0 would not be understood.
skipping to change at line 412 skipping to change at line 412
} }
else { else {
croak "Couldn't retrieve command settings properly\n"; croak "Couldn't retrieve command settings properly\n";
} }
} }
sub new_session { sub new_session {
my ( $self, $extra_capabilities ) = @_; my ( $self, $extra_capabilities ) = @_;
$extra_capabilities ||= {}; $extra_capabilities ||= {};
#XXX chromedriver is broken
$FORCE_WD2 = 1 if $self->browser_name eq 'chrome';
my $args = { my $args = {
'desiredCapabilities' => { 'desiredCapabilities' => {
'browserName' => $self->browser_name, 'browserName' => $self->browser_name,
'platform' => $self->platform, 'platform' => $self->platform,
'javascriptEnabled' => $self->javascript, 'javascriptEnabled' => $self->javascript,
'version' => $self->version, 'version' => $self->version,
'acceptSslCerts' => $self->accept_ssl_certs, 'acceptSslCerts' => $self->accept_ssl_certs,
%$extra_capabilities, %$extra_capabilities,
}, },
}; };
skipping to change at line 479 skipping to change at line 476
{ {
$args->{capabilities}->{alwaysMatch}->{$cap}->{args} = $args->{capabilities}->{alwaysMatch}->{$cap}->{args} =
$args->{capabilities}->{alwaysMatch}->{'moz:firefoxOptions'} $args->{capabilities}->{alwaysMatch}->{'moz:firefoxOptions'}
->{args}; ->{args};
} }
$args->{capabilities}->{alwaysMatch}->{'moz:firefoxOptions'} = $args->{capabilities}->{alwaysMatch}->{'moz:firefoxOptions'} =
$args->{capabilities}->{alwaysMatch}->{$cap} $args->{capabilities}->{alwaysMatch}->{$cap}
if $args->{desiredCapabilities}->{browserName} eq 'firefox'; if $args->{desiredCapabilities}->{browserName} eq 'firefox';
#XXX the chrome documentation is lies, you can't do this yet #XXX the chrome documentation is lies, you can't do this yet
#$args->{capabilities}->{alwaysMatch}->{'chromeOptions'} = $args->{capabili ties}->{alwaysMatch}->{$cap} if $args->{desiredCapabilities}->{browserName} eq ' chrome'; #$args->{capabilities}->{alwaysMatch}->{'goog:chromeOptions'} = $args->{cap abilities}->{alwaysMatch}->{$cap} if $args->{desiredCapabilities}->{browserName} eq 'chrome';
#Does not appear there are any MSIE based options, so let's just let that be #Does not appear there are any MSIE based options, so let's just let that be
} }
if ( exists( $args->{desiredCapabilities}->{browserName} ) if ( exists( $args->{desiredCapabilities}->{browserName} )
&& $args->{desiredCapabilities}->{browserName} eq 'firefox' && $args->{desiredCapabilities}->{browserName} eq 'firefox'
&& $cap eq 'firefox_profile' ) && $cap eq 'firefox_profile' )
{ {
if ( if (
ref $args->{capabilities}->{alwaysMatch}->{$cap} eq ref $args->{capabilities}->{alwaysMatch}->{$cap} eq
'Selenium::Firefox::Profile' ) 'Selenium::Firefox::Profile' )
{ {
skipping to change at line 522 skipping to change at line 519
} }
delete $args->{capabilities}->{alwaysMatch}->{$cap} delete $args->{capabilities}->{alwaysMatch}->{$cap}
if !any { $_ eq $cap } @$caps; if !any { $_ eq $cap } @$caps;
} }
delete $args->{desiredCapabilities} delete $args->{desiredCapabilities}
if $FORCE_WD3; #XXX fork working-around busted fallback in firefox if $FORCE_WD3; #XXX fork working-around busted fallback in firefox
delete $args->{capabilities} delete $args->{capabilities}
if $FORCE_WD2; #XXX 'secret' feature to help the legacy unit tests to work if $FORCE_WD2; #XXX 'secret' feature to help the legacy unit tests to work
#Delete compatibility layer when using drivers directly #Delete compatibility layer when using drivers directly
if ( $self->isa('Selenium::Firefox') ) { if ( $self->isa('Selenium::Firefox') || $self->isa('Selenium::Chrome') ) {
if ( exists $args->{capabilities} if ( exists $args->{capabilities}
&& exists $args->{capabilities}->{alwaysMatch} ) && exists $args->{capabilities}->{alwaysMatch} )
{ {
delete $args->{capabilities}->{alwaysMatch}->{browserName}; delete $args->{capabilities}->{alwaysMatch}->{browserName};
delete $args->{capabilities}->{alwaysMatch}->{browserVersion}; delete $args->{capabilities}->{alwaysMatch}->{browserVersion};
delete $args->{capabilities}->{alwaysMatch}->{platformName}; delete $args->{capabilities}->{alwaysMatch}->{platformName};
} }
} }
#Fix broken out of the box chrome because they hate the maintainers of their interfaces #Fix broken out of the box chrome because they hate the maintainers of their interfaces
if ( $self->isa('Selenium::Chrome') ) { if ( $self->isa('Selenium::Chrome') ) {
if ( exists $args->{desiredCapabilities} ) { if ( exists $args->{desiredCapabilities} ) {
$args->{desiredCapabilities}{chromeOptions}{args} //= []; $args->{desiredCapabilities}{'goog:chromeOptions'}{args} //= [];
push(@{$args->{desiredCapabilities}{chromeOptions}{args}}, qw{no-san push(@{$args->{desiredCapabilities}{'goog:chromeOptions'}{args}}, qw
dbox disable-dev-shm-usage}); {no-sandbox disable-dev-shm-usage});
} }
} }
# Get actual status # Get actual status
$self->remote_conn->check_status(); $self->remote_conn->check_status();
# command => 'newSession' to fool the tests of commands implemented # command => 'newSession' to fool the tests of commands implemented
# TODO: rewrite the testing better, this is so fragile. # TODO: rewrite the testing better, this is so fragile.
my $resource_new_session = { my $resource_new_session = {
method => $self->commands->get_method('newSession'), method => $self->commands->get_method('newSession'),
skipping to change at line 644 skipping to change at line 641
sub get_alert_text { sub get_alert_text {
my ($self) = @_; my ($self) = @_;
my $res = { 'command' => 'getAlertText' }; my $res = { 'command' => 'getAlertText' };
return $self->_execute_command($res); return $self->_execute_command($res);
} }
sub send_keys_to_active_element { sub send_keys_to_active_element {
my ( $self, @strings ) = @_; my ( $self, @strings ) = @_;
if ( $self->{is_wd3} if ( $self->{is_wd3}
&& !( grep { $self->browser_name eq $_ } qw{chrome MicrosoftEdge} ) ) && !( grep { $self->browser_name eq $_ } qw{MicrosoftEdge} ) )
{ {
@strings = map { split( '', $_ ) } @strings; @strings = map { split( '', $_ ) } @strings;
my @acts = map { my @acts = map {
( (
{ {
type => 'keyDown', type => 'keyDown',
value => $_, value => $_,
}, },
{ {
type => 'keyUp', type => 'keyUp',
skipping to change at line 746 skipping to change at line 743
my $res = { 'command' => 'releaseGeneralAction' }; my $res = { 'command' => 'releaseGeneralAction' };
%CURRENT_ACTION_CHAIN = ( actions => [] ); %CURRENT_ACTION_CHAIN = ( actions => [] );
return $self->_execute_command($res); return $self->_execute_command($res);
} }
sub mouse_move_to_location { sub mouse_move_to_location {
my ( $self, %params ) = @_; my ( $self, %params ) = @_;
$params{element} = $params{element}{id} if exists $params{element}; $params{element} = $params{element}{id} if exists $params{element};
if ( $self->{is_wd3} if ( $self->{is_wd3}
&& !( grep { $self->browser_name eq $_ } qw{chrome MicrosoftEdge} ) ) && !( grep { $self->browser_name eq $_ } qw{MicrosoftEdge} ) )
{ {
my $origin = $params{element}; my $origin = $params{element};
my $move_action = { my $move_action = {
type => "pointerMove", type => "pointerMove",
duration => 0, duration => 0,
x => $params{xoffset} // 0, x => $params{xoffset} // 0,
y => $params{yoffset} // 0, y => $params{yoffset} // 0,
}; };
$move_action->{origin} = $move_action->{origin} =
{ 'element-6066-11e4-a52e-4f735466cecf' => $origin } { 'element-6066-11e4-a52e-4f735466cecf' => $origin }
skipping to change at line 871 skipping to change at line 868
my $self = shift; my $self = shift;
my $res = { 'command' => 'getWindowHandles' }; my $res = { 'command' => 'getWindowHandles' };
return $self->_execute_command($res); return $self->_execute_command($res);
} }
sub get_window_size { sub get_window_size {
my ( $self, $window ) = @_; my ( $self, $window ) = @_;
$window = ( defined $window ) ? $window : 'current'; $window = ( defined $window ) ? $window : 'current';
my $res = { 'command' => 'getWindowSize', 'window_handle' => $window }; my $res = { 'command' => 'getWindowSize', 'window_handle' => $window };
$res = { 'command' => 'getWindowRect', handle => $window } $res = { 'command' => 'getWindowRect', handle => $window }
if $self->{is_wd3} && $self->browser_name ne 'chrome'; if $self->{is_wd3};
return $self->_execute_command($res); return $self->_execute_command($res);
} }
sub get_window_position { sub get_window_position {
my ( $self, $window ) = @_; my ( $self, $window ) = @_;
$window = ( defined $window ) ? $window : 'current'; $window = ( defined $window ) ? $window : 'current';
my $res = { 'command' => 'getWindowPosition', 'window_handle' => $window }; my $res = { 'command' => 'getWindowPosition', 'window_handle' => $window };
$res = { 'command' => 'getWindowRect', handle => $window } $res = { 'command' => 'getWindowRect', handle => $window }
if $self->{is_wd3} && $self->browser_name ne 'chrome'; if $self->{is_wd3};
return $self->_execute_command($res); return $self->_execute_command($res);
} }
sub get_current_url { sub get_current_url {
my $self = shift; my $self = shift;
my $res = { 'command' => 'getCurrentUrl' }; my $res = { 'command' => 'getCurrentUrl' };
return $self->_execute_command($res); return $self->_execute_command($res);
} }
sub navigate { sub navigate {
skipping to change at line 952 skipping to change at line 949
} }
my $res = my $res =
{ 'command' => 'executeAsyncScript' . $self->_execute_script_suffix }; { 'command' => 'executeAsyncScript' . $self->_execute_script_suffix };
# Check the args array if the elem obj is provided & replace it with # Check the args array if the elem obj is provided & replace it with
# JSON representation # JSON representation
for ( my $i = 0 ; $i < @args ; $i++ ) { for ( my $i = 0 ; $i < @args ; $i++ ) {
if ( Scalar::Util::blessed( $args[$i] ) if ( Scalar::Util::blessed( $args[$i] )
and $args[$i]->isa('Selenium::Remote::WebElement') ) and $args[$i]->isa('Selenium::Remote::WebElement') )
{ {
if ( $self->{is_wd3} && $self->browser_name ne 'chrome' ) { if ( $self->{is_wd3} ) {
$args[$i] = $args[$i] =
{ 'element-6066-11e4-a52e-4f735466cecf' => { 'element-6066-11e4-a52e-4f735466cecf' =>
( $args[$i] )->{id} }; ( $args[$i] )->{id} };
} }
else { else {
$args[$i] = { 'ELEMENT' => ( $args[$i] )->{id} }; $args[$i] = { 'ELEMENT' => ( $args[$i] )->{id} };
} }
} }
} }
skipping to change at line 998 skipping to change at line 995
} }
my $res = my $res =
{ 'command' => 'executeScript' . $self->_execute_script_suffix }; { 'command' => 'executeScript' . $self->_execute_script_suffix };
# Check the args array if the elem obj is provided & replace it with # Check the args array if the elem obj is provided & replace it with
# JSON representation # JSON representation
for ( my $i = 0 ; $i < @args ; $i++ ) { for ( my $i = 0 ; $i < @args ; $i++ ) {
if ( Scalar::Util::blessed( $args[$i] ) if ( Scalar::Util::blessed( $args[$i] )
and $args[$i]->isa('Selenium::Remote::WebElement') ) and $args[$i]->isa('Selenium::Remote::WebElement') )
{ {
if ( $self->{is_wd3} && $self->browser_name ne 'chrome' ) { if ( $self->{is_wd3} ) {
$args[$i] = $args[$i] =
{ 'element-6066-11e4-a52e-4f735466cecf' => { 'element-6066-11e4-a52e-4f735466cecf' =>
( $args[$i] )->{id} }; ( $args[$i] )->{id} };
} }
else { else {
$args[$i] = { 'ELEMENT' => ( $args[$i] )->{id} }; $args[$i] = { 'ELEMENT' => ( $args[$i] )->{id} };
} }
} }
} }
skipping to change at line 1067 skipping to change at line 1064
return \@array; return \@array;
} }
return $ret; return $ret;
} }
sub screenshot { sub screenshot {
my ($self, $params) = @_; my ($self, $params) = @_;
$params //= { full => 0 }; $params //= { full => 0 };
croak "Full page screenshot only supported on geckodriver" if $params->{full } && ( $self->{browser} ne 'firefox' ); croak "Full page screenshot only supported on geckodriver" if $params->{full } && ( $self->{browser_name} ne 'firefox' );
my $res = { 'command' => $params->{'full'} == 1 ? 'mozScreenshotFull' : 'scr eenshot' }; my $res = { 'command' => $params->{'full'} == 1 ? 'mozScreenshotFull' : 'scr eenshot' };
return $self->_execute_command($res); return $self->_execute_command($res);
} }
sub capture_screenshot { sub capture_screenshot {
my ( $self, $filename, $params ) = @_; my ( $self, $filename, $params ) = @_;
croak '$filename is required' unless $filename; croak '$filename is required' unless $filename;
open( my $fh, '>', $filename ); open( my $fh, '>', $filename );
skipping to change at line 1102 skipping to change at line 1099
sub switch_to_frame { sub switch_to_frame {
my ( $self, $id ) = @_; my ( $self, $id ) = @_;
my $json_null = JSON::null; my $json_null = JSON::null;
my $params; my $params;
$id = ( defined $id ) ? $id : $json_null; $id = ( defined $id ) ? $id : $json_null;
my $res = { 'command' => 'switchToFrame' }; my $res = { 'command' => 'switchToFrame' };
if ( ref $id eq $self->webelement_class ) { if ( ref $id eq $self->webelement_class ) {
if ( $self->{is_wd3} && $self->browser_name ne 'chrome' ) { if ( $self->{is_wd3} ) {
$params = $params =
{ 'id' => { 'id' =>
{ 'element-6066-11e4-a52e-4f735466cecf' => $id->{'id'} } }; { 'element-6066-11e4-a52e-4f735466cecf' => $id->{'id'} } };
} }
else { else {
$params = { 'id' => { 'ELEMENT' => $id->{'id'} } }; $params = { 'id' => { 'ELEMENT' => $id->{'id'} } };
} }
} }
else { else {
$params = { 'id' => $id }; $params = { 'id' => $id };
skipping to change at line 1148 skipping to change at line 1145
} }
croak qq{Error: In set_window_size, argument x "$x" isn't numeric} croak qq{Error: In set_window_size, argument x "$x" isn't numeric}
unless Scalar::Util::looks_like_number($x); unless Scalar::Util::looks_like_number($x);
croak qq{Error: In set_window_size, argument y "$y" isn't numeric} croak qq{Error: In set_window_size, argument y "$y" isn't numeric}
unless Scalar::Util::looks_like_number($y); unless Scalar::Util::looks_like_number($y);
$x += $x +=
0; # convert to numeric if a string, otherwise they'll be sent as strings 0; # convert to numeric if a string, otherwise they'll be sent as strings
$y += 0; $y += 0;
my $res = { 'command' => 'setWindowPosition', 'window_handle' => $window }; my $res = { 'command' => 'setWindowPosition', 'window_handle' => $window };
my $params = { 'x' => $x, 'y' => $y }; my $params = { 'x' => $x, 'y' => $y };
if ( $self->{is_wd3} && $self->browser_name ne 'chrome' ) { if ( $self->{is_wd3} ) {
$res = { 'command' => 'setWindowRect', handle => $window }; $res = { 'command' => 'setWindowRect', handle => $window };
} }
my $ret = $self->_execute_command( $res, $params ); my $ret = $self->_execute_command( $res, $params );
return $ret ? 1 : 0; return $ret ? 1 : 0;
} }
sub set_window_size { sub set_window_size {
my ( $self, $height, $width, $window ) = @_; my ( $self, $height, $width, $window ) = @_;
$window = ( defined $window ) ? $window : 'current'; $window = ( defined $window ) ? $window : 'current';
if ( not defined $height and not defined $width ) { if ( not defined $height and not defined $width ) {
skipping to change at line 1170 skipping to change at line 1167
} }
croak qq{Error: In set_window_size, argument height "$height" isn't numeric} croak qq{Error: In set_window_size, argument height "$height" isn't numeric}
unless Scalar::Util::looks_like_number($height); unless Scalar::Util::looks_like_number($height);
croak qq{Error: In set_window_size, argument width "$width" isn't numeric} croak qq{Error: In set_window_size, argument width "$width" isn't numeric}
unless Scalar::Util::looks_like_number($width); unless Scalar::Util::looks_like_number($width);
$height += $height +=
0; # convert to numeric if a string, otherwise they'll be sent as strings 0; # convert to numeric if a string, otherwise they'll be sent as strings
$width += 0; $width += 0;
my $res = { 'command' => 'setWindowSize', 'window_handle' => $window }; my $res = { 'command' => 'setWindowSize', 'window_handle' => $window };
my $params = { 'height' => $height, 'width' => $width }; my $params = { 'height' => $height, 'width' => $width };
if ( $self->{is_wd3} && $self->browser_name ne 'chrome' ) { if ( $self->{is_wd3} ) {
$res = { 'command' => 'setWindowRect', handle => $window }; $res = { 'command' => 'setWindowRect', handle => $window };
} }
my $ret = $self->_execute_command( $res, $params ); my $ret = $self->_execute_command( $res, $params );
return $ret ? 1 : 0; return $ret ? 1 : 0;
} }
sub maximize_window { sub maximize_window {
my ( $self, $window ) = @_; my ( $self, $window ) = @_;
if ( $self->{is_wd3} && $self->browser_name eq 'chrome' ) {
my $h = $self->execute_script(q{return screen.availHeight});
my $w = $self->execute_script(q{return screen.availWidth});
return $self->set_window_size( $h, $w );
}
$window = ( defined $window ) ? $window : 'current'; $window = ( defined $window ) ? $window : 'current';
my $res = { 'command' => 'maximizeWindow', 'window_handle' => $window }; my $res = { 'command' => 'maximizeWindow', 'window_handle' => $window };
my $ret = $self->_execute_command($res); my $ret = $self->_execute_command($res);
return $ret ? 1 : 0; return $ret ? 1 : 0;
} }
sub minimize_window { sub minimize_window {
my ( $self, $window ) = @_; my ( $self, $window ) = @_;
$window = ( defined $window ) ? $window : 'current'; $window = ( defined $window ) ? $window : 'current';
my $res = { 'command' => 'minimizeWindow', 'window_handle' => $window }; my $res = { 'command' => 'minimizeWindow', 'window_handle' => $window };
skipping to change at line 1504 skipping to change at line 1496
return $self->_execute_command($res); return $self->_execute_command($res);
} }
sub send_modifier { sub send_modifier {
my ( $self, $modifier, $isdown ) = @_; my ( $self, $modifier, $isdown ) = @_;
if ( $isdown =~ /(down|up)/ ) { if ( $isdown =~ /(down|up)/ ) {
$isdown = $isdown =~ /down/ ? 1 : 0; $isdown = $isdown =~ /down/ ? 1 : 0;
} }
if ( $self->{is_wd3} if ( $self->{is_wd3}
&& !( grep { $self->browser_name eq $_ } qw{chrome MicrosoftEdge} ) ) && !( grep { $self->browser_name eq $_ } qw{MicrosoftEdge} ) )
{ {
my $acts = [ my $acts = [
{ {
type => $isdown ? 'keyDown' : 'keyUp', type => $isdown ? 'keyDown' : 'keyUp',
value => KEYS->{ lc($modifier) }, value => KEYS->{ lc($modifier) },
}, },
]; ];
my $action = { my $action = {
actions => [ actions => [
skipping to change at line 1552 skipping to change at line 1544
} }
sub click { sub click {
my ( $self, $button, $append ) = @_; my ( $self, $button, $append ) = @_;
$button = _get_button($button); $button = _get_button($button);
my $res = { 'command' => 'click' }; my $res = { 'command' => 'click' };
my $params = { 'button' => $button }; my $params = { 'button' => $button };
if ( $self->{is_wd3} if ( $self->{is_wd3}
&& !( grep { $self->browser_name eq $_ } qw{chrome MicrosoftEdge} ) ) && !( grep { $self->browser_name eq $_ } qw{MicrosoftEdge} ) )
{ {
$params = { $params = {
actions => [ actions => [
{ {
type => "pointer", type => "pointer",
id => 'mouse', id => 'mouse',
parameters => { "pointerType" => "mouse" }, parameters => { "pointerType" => "mouse" },
actions => [ actions => [
{ {
type => "pointerDown", type => "pointerDown",
skipping to change at line 1603 skipping to change at line 1595
} }
return 0; return 0;
} }
sub double_click { sub double_click {
my ( $self, $button ) = @_; my ( $self, $button ) = @_;
$button = _get_button($button); $button = _get_button($button);
if ( $self->{is_wd3} if ( $self->{is_wd3}
&& !( grep { $self->browser_name eq $_ } qw{chrome MicrosoftEdge} ) ) && !( grep { $self->browser_name eq $_ } qw{MicrosoftEdge} ) )
{ {
$self->click( $button, 1 ); $self->click( $button, 1 );
$self->click( $button, 1 ); $self->click( $button, 1 );
$self->general_action(); $self->general_action();
} }
my $res = { 'command' => 'doubleClick' }; my $res = { 'command' => 'doubleClick' };
return $self->_execute_command($res); return $self->_execute_command($res);
} }
sub button_down { sub button_down {
my ($self) = @_; my ($self) = @_;
if ( $self->{is_wd3} if ( $self->{is_wd3}
&& !( grep { $self->browser_name eq $_ } qw{chrome MicrosoftEdge} ) ) && !( grep { $self->browser_name eq $_ } qw{MicrosoftEdge} ) )
{ {
my $params = { my $params = {
actions => [ actions => [
{ {
type => "pointer", type => "pointer",
id => 'mouse', id => 'mouse',
parameters => { "pointerType" => "mouse" }, parameters => { "pointerType" => "mouse" },
actions => [ actions => [
{ {
type => "pointerDown", type => "pointerDown",
skipping to change at line 1648 skipping to change at line 1640
} }
my $res = { 'command' => 'buttonDown' }; my $res = { 'command' => 'buttonDown' };
return $self->_execute_command($res); return $self->_execute_command($res);
} }
sub button_up { sub button_up {
my ($self) = @_; my ($self) = @_;
if ( $self->{is_wd3} if ( $self->{is_wd3}
&& !( grep { $self->browser_name eq $_ } qw{chrome MicrosoftEdge} ) ) && !( grep { $self->browser_name eq $_ } qw{MicrosoftEdge} ) )
{ {
my $params = { my $params = {
actions => [ actions => [
{ {
type => "pointer", type => "pointer",
id => 'mouse', id => 'mouse',
parameters => { "pointerType" => "mouse" }, parameters => { "pointerType" => "mouse" },
actions => [ actions => [
{ {
type => "pointerDown", type => "pointerDown",
skipping to change at line 1805 skipping to change at line 1797
=pod =pod
=encoding UTF-8 =encoding UTF-8
=head1 NAME =head1 NAME
Selenium::Remote::Driver - Perl Client for Selenium Remote Driver Selenium::Remote::Driver - Perl Client for Selenium Remote Driver
=head1 VERSION =head1 VERSION
version 1.33 version 1.36
=head1 SYNOPSIS =head1 SYNOPSIS
use Selenium::Remote::Driver; use Selenium::Remote::Driver;
my $driver = Selenium::Remote::Driver->new; my $driver = Selenium::Remote::Driver->new;
$driver->get('http://www.google.com'); $driver->get('http://www.google.com');
print $driver->get_title(); print $driver->get_title();
$driver->quit(); $driver->quit();
skipping to change at line 1995 skipping to change at line 1987
=head2 Firefox Notes =head2 Firefox Notes
If you are intending to pass extra_capabilities to firefox on a WD3 enabled serv er with geckodriver, you MUST do the following: If you are intending to pass extra_capabilities to firefox on a WD3 enabled serv er with geckodriver, you MUST do the following:
$Selenium::Remote::Driver::FORCE_WD3=1; $Selenium::Remote::Driver::FORCE_WD3=1;
This is because the gecko driver prefers legacy capabilities, both of which are normally passed for compatibility reasons. This is because the gecko driver prefers legacy capabilities, both of which are normally passed for compatibility reasons.
=head2 Chrome Notes =head2 Chrome Notes
extra_capabilities may? not work, because chromedriver considers the chromeOptio Use the option goog:chromeOptions instead of chromeOptions, if you are intending
ns parameter to be invalid, despite it's documentation here: to pass extra_capabilities on a
WD3 enabled server with chromedriver enabled.
https://sites.google.com/a/chromium.org/chromedriver/capabilities https://sites.google.com/a/chromium.org/chromedriver/capabilities
Other bindings get around this by just using the 'old' way of passing desired ca Also, if you instantiate the object in WC3 mode (which is the default), the remo
pabilities. You can do this too like so: te driver will throw exceptions you have no choice but to catch,
rather than falling back to JSONWire methods where applicable like geckodriver d
$Selenium::Remote::Driver::FORCE_WD2=1; oes.
This is now forced on during construction for chrome.
=head1 CONSTRUCTOR =head1 CONSTRUCTOR
=head2 new =head2 new
Dies if communication with the selenium server cannot be established. Dies if communication with the selenium server cannot be established.
Input: (all optional) Input: (all optional)
Desired capabilities - HASH - Following options are accepted: Desired capabilities - HASH - Following options are accepted:
skipping to change at line 2126 skipping to change at line 2116
}); });
#or #or
my $driver = Selenium::Remote::Driver->new('remote_server_addr' => '10.10.1. 1', my $driver = Selenium::Remote::Driver->new('remote_server_addr' => '10.10.1. 1',
'port' => '2222', 'port' => '2222',
'auto_close' => 0); 'auto_close' => 0);
#or #or
my $driver = Selenium::Remote::Driver->new('browser_name' =>'chrome', my $driver = Selenium::Remote::Driver->new('browser_name' =>'chrome',
'extra_capabilities' => { 'extra_capabilities' => {
'chromeOptions' => { 'goog:chromeOptions' => {
'args' => [ 'args' => [
'window-size=1260,960 ', 'window-size=1260,960 ',
'incognito' 'incognito'
], ],
'prefs' => { 'prefs' => {
'session' => { 'session' => {
'restore_on_start up' => 4, 'restore_on_start up' => 4,
'urls_to_restore_ on_startup' => [ 'urls_to_restore_ on_startup' => [
'http://www.g oogle.com', 'http://www.g oogle.com',
'http://docs. seleniumhq.org' 'http://docs. seleniumhq.org'
skipping to change at line 2296 skipping to change at line 2286
Basically the same as new_session, but with caps. Basically the same as new_session, but with caps.
Sort of an analog to new_from_caps. Sort of an analog to new_from_caps.
=head2 is_webdriver_3 =head2 is_webdriver_3
Print whether the server (or browser) thinks it's implemented webdriver 3. Print whether the server (or browser) thinks it's implemented webdriver 3.
If this returns true, webdriver 3 methods will be used in the case an action exi sts in L<Selenium::Remote::Spec> for the method you are trying to call. If this returns true, webdriver 3 methods will be used in the case an action exi sts in L<Selenium::Remote::Spec> for the method you are trying to call.
If a method you are calling has no webdriver 3 equivalent (or browser extension) , the legacy commands implemented in L<Selenium::Remote::Commands> will be used. If a method you are calling has no webdriver 3 equivalent (or browser extension) , the legacy commands implemented in L<Selenium::Remote::Commands> will be used.
Note how I said *thinks* above. In the case you want to force usage of legacy m ethods, call set_webdriver_3() to work around various browser issues. Note how I said *thinks* above. In the case you want to force usage of legacy m ethods, set $driver->{is_wd3} to work around various browser issues.
=head2 debug_on =head2 debug_on
Description: Description:
Turns on debugging mode and the driver will print extra info like request Turns on debugging mode and the driver will print extra info like request
and response to stdout. Useful, when you want to see what is being sent to and response to stdout. Useful, when you want to see what is being sent to
the server & what response you are getting back. the server & what response you are getting back.
Usage: Usage:
$driver->debug_on; $driver->debug_on;
skipping to change at line 2377 skipping to change at line 2367
{ARRAY | STRING} - Array of strings or a string. {ARRAY | STRING} - Array of strings or a string.
Usage: Usage:
$driver->send_keys_to_active_element('abcd', 'efg'); $driver->send_keys_to_active_element('abcd', 'efg');
$driver->send_keys_to_active_element('hijk'); $driver->send_keys_to_active_element('hijk');
or or
# include the WDKeys module # include the WDKeys module
use Selenium::Remote::WDKeys; use Selenium::Remote::WDKeys;
.
.
$driver->send_keys_to_active_element(KEYS->{'space'}, KEYS->{'enter'}); $driver->send_keys_to_active_element(KEYS->{'space'}, KEYS->{'enter'});
=head2 send_keys_to_alert =head2 send_keys_to_alert
Synonymous with send_keys_to_prompt Synonymous with send_keys_to_prompt
=head2 send_keys_to_prompt =head2 send_keys_to_prompt
Description: Description:
Sends keystrokes to a JavaScript prompt() dialog. Sends keystrokes to a JavaScript prompt() dialog.
skipping to change at line 3635 skipping to change at line 3623
=over 4 =over 4
=item * =item *
Aditya Ivaturi <ivaturi@gmail.com> Aditya Ivaturi <ivaturi@gmail.com>
=back =back
=head1 CONTRIBUTORS =head1 CONTRIBUTORS
=for stopwords Allen Lew A.MacLeay Andy Jack Bas Bloemsaat Brian Horakh Charles Howes Chris Davies Daniel Fackrell Dave Rolsky Dmitry Karasik Doug Bell Eric Joh nson Gabor Szabo George S. Baugh Gerhard Jungwirth Gordon Child GreatFlamingFoo Ivan Kurmanov Joe Higton Jon Hermansen Keita Sugama Ken Swanson lembark Luke Clo ss Martin Gruner Max O'Cull Michael Prokop Peter Mottram (SysPete) Phil Kania Mi tchell Prateek Goyal Richard Sailer Robert Utter rouzier Tetsuya Tatsumi Tod Hag an Tom Hukins Vangelis Katsikaros Vishwanath Janmanchi Viťas Strádal Yves Lavoie =for stopwords Allen Lew A.MacLeay Andy Jack Bas Bloemsaat Blake GH Brian Horakh Charles Howes Chris Davies Daniel Fackrell Dave Rolsky Dmitry Karasik Doug Bell Eric Johnson Gabor Szabo George S. Baugh Gerhard Jungwirth Gordon Child GreatFl amingFoo Ivan Kurmanov Joe Higton Jon Hermansen Keita Sugama Ken Swanson lembark Luke Closs Martin Gruner Matthew Spahr Max O'Cull Michael Prokop Peter Mottram (SysPete) Phil Kania Mitchell Prateek Goyal Richard Sailer Robert Utter rouzier Tetsuya Tatsumi Tod Hagan Tom Hukins Vangelis Katsikaros Vishwanath Janmanchi Vi ťas Strádal Yves Lavoie
=over 4 =over 4
=item * =item *
Allen Lew <allen@alew.org> Allen Lew <allen@alew.org>
=item * =item *
A.MacLeay <a.macleay@gmail.com> A.MacLeay <a.macleay@gmail.com>
skipping to change at line 3661 skipping to change at line 3649
=item * =item *
Andy Jack <github@veracity.ca> Andy Jack <github@veracity.ca>
=item * =item *
Bas Bloemsaat <bas@bloemsaat.com> Bas Bloemsaat <bas@bloemsaat.com>
=item * =item *
Blake GH <blake@mobiusconsortium.org>
=item *
Brian Horakh <brianh@zoovy.com> Brian Horakh <brianh@zoovy.com>
=item * =item *
Charles Howes <charles.howes@globalrelay.net> Charles Howes <charles.howes@globalrelay.net>
=item * =item *
Chris Davies <FMQA@users.noreply.github.com> Chris Davies <FMQA@users.noreply.github.com>
skipping to change at line 3745 skipping to change at line 3737
=item * =item *
Luke Closs <lukec@users.noreply.github.com> Luke Closs <lukec@users.noreply.github.com>
=item * =item *
Martin Gruner <martin.gruner@otrs.com> Martin Gruner <martin.gruner@otrs.com>
=item * =item *
Matthew Spahr <matthew.spahr@cpanel.net>
=item *
Max O'Cull <maxattax97@gmail.com> Max O'Cull <maxattax97@gmail.com>
=item * =item *
Michael Prokop <mprokop@sipwise.com> Michael Prokop <mprokop@sipwise.com>
=item * =item *
Peter Mottram (SysPete) <peter@sysnix.com> Peter Mottram (SysPete) <peter@sysnix.com>
 End of changes. 31 change blocks. 
43 lines changed or deleted 40 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)