|
@@ -186,6 +186,14 @@ you please.
|
|
|
=head1 WC3 WEBDRIVER COMPATIBILITY
|
|
=head1 WC3 WEBDRIVER COMPATIBILITY
|
|
|
|
|
|
|
|
WC3 Webdriver is a constantly evolving standard, so some things may or may not work at any given time.
|
|
WC3 Webdriver is a constantly evolving standard, so some things may or may not work at any given time.
|
|
|
|
|
+
|
|
|
|
|
+Furthermore, out of date drivers probably identify as WD3, while only implementing a few methods and retaining JSONWire functionality.
|
|
|
|
|
+One way of dealing with this is setting:
|
|
|
|
|
+
|
|
|
|
|
+ $driver->{is_wd3} = 0
|
|
|
|
|
+
|
|
|
|
|
+Of course, this will prevent access of any new WC3 methods, but will probably make your tests pass until your browser's driver gets it's act together.
|
|
|
|
|
+
|
|
|
That said, the following 'sanity tests' in the at/ (acceptance test) directory of the module passed on the following versions:
|
|
That said, the following 'sanity tests' in the at/ (acceptance test) directory of the module passed on the following versions:
|
|
|
|
|
|
|
|
=over 4
|
|
=over 4
|
|
@@ -1649,6 +1657,7 @@ 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 } if $self->{is_wd3} && $self->browser_name ne 'chrome';
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1677,6 +1686,7 @@ 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 } if $self->{is_wd3} && $self->browser_name ne 'chrome';
|
|
|
return $self->_execute_command($res);
|
|
return $self->_execute_command($res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2207,6 +2217,9 @@ sub set_window_position {
|
|
|
}
|
|
}
|
|
|
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') {
|
|
|
|
|
+ $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;
|
|
|
}
|
|
}
|
|
@@ -2243,6 +2256,9 @@ sub set_window_size {
|
|
|
$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') {
|
|
|
|
|
+ $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;
|
|
|
}
|
|
}
|