Browse Source

Fix #141: cast height and width to integers

Daniel Gempesaw 11 năm trước cách đây
mục cha
commit
b62dd7b675
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      lib/Selenium/Remote/Driver.pm

+ 2 - 0
lib/Selenium/Remote/Driver.pm

@@ -1584,6 +1584,8 @@ sub set_window_size {
     if ( not defined $height and not defined $width ) {
     if ( not defined $height and not defined $width ) {
         croak "height & width of browser are required";
         croak "height & width of browser are required";
     }
     }
+    $height += 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 };
     my $ret = $self->_execute_command( $res, $params );
     my $ret = $self->_execute_command( $res, $params );