Răsfoiți Sursa

Fixed bug in Commands.pm: definition of setImplicitWaitTimeout
Added note about set_speed: a no-op for WebDriver, should be deprecated?
Fixed bug in Driver.pm: missing 'css' entry in FINDERS
Fixed bug in Driver.pm::find_elements: set up $using correctly

Phil Mitchell 14 ani în urmă
părinte
comite
279b80cf74
3 a modificat fișierele cu 15 adăugiri și 3 ștergeri
  1. 7 0
      Changes
  2. 1 1
      lib/Selenium/Remote/Commands.pm
  3. 7 2
      lib/Selenium/Remote/Driver.pm

+ 7 - 0
Changes

@@ -1,5 +1,12 @@
 Revision history for Selenium-Remote-Driver
 
+07/21/11 - PM
+
+Fixed bug in Commands.pm: definition of setImplicitWaitTimeout
+Added note about set_speed: a no-op for WebDriver, should be deprecated?
+Fixed bug in Driver.pm: missing 'css' entry in FINDERS
+Fixed bug in Driver.pm::find_elements: set up $using correctly
+
 0.10    5-2-2010
         - Implemented support for JSON wire protocol as of a4 release of
         Selenium 2.0.

+ 1 - 1
lib/Selenium/Remote/Commands.pm

@@ -18,7 +18,7 @@ sub new {
         },
         'setImplicitWaitTimeout' => {
                         'method' => 'POST',
-                        'url'    => 'session/:session_id/timeouts/implicit_wait'
+                        'url'    => 'session/:sessionId/timeouts/implicit_wait'
         },
         'quit' => {
                     'method' => 'DELETE',

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

@@ -13,6 +13,7 @@ use Selenium::Remote::WebElement;
 use constant FINDERS => {
       class             => 'class name',
       class_name        => 'class name',
+      css               => 'css selector',
       id                => 'id',
       link              => 'link text',
       link_text         => 'link text',
@@ -715,6 +716,10 @@ sub get_speed {
  Usage:
     $driver->set_speed('MEDIUM');
 
+ Note: This function is a no-op in WebDriver (?). See
+       https://groups.google.com/d/topic/selenium-users/oX0ZnYFPuSA/discussion and
+       http://code.google.com/p/selenium/source/browse/trunk/java/client/src/org/openqa/selenium/WebDriverCommandProcessor.java
+
 =cut
 
 sub set_speed {
@@ -929,8 +934,8 @@ sub find_elements {
     if ( not defined $query ) {
         return 'Search string to find element not provided.';
     }
-    my $using = ( defined $method ) ? $method : 'xpath';
-    if (exists FINDERS->{$using}) {
+    my $using = ( defined $method ) ? FINDERS->{$method} : 'xpath';
+    if (defined $using) {
         my $res = { 'command' => 'findElements' };
         my $params = { 'using' => $using, 'value' => $query };
         my $ret_data = $self->_execute_command( $res, $params );