Browse Source

Fix #366 - use a better ID finder polyfill for WD3 find() and friends

George S. Baugh 7 years ago
parent
commit
e7b616b50e
4 changed files with 7 additions and 3 deletions
  1. 4 0
      Changes
  2. 1 1
      dist.ini
  3. 1 1
      lib/Selenium/Remote/Spec.pm
  4. 1 1
      t/01-webdriver3.t

+ 4 - 0
Changes

@@ -1,5 +1,9 @@
 Revision history for Selenium-Remote-Driver
 
+1.24   02-06-2018 TEODESIAN
+        [BUG FIXES]
+        - Fix issue where ID finder polyfills failed on IDs with dots (.) in them.
+
 1.23   01-29-2018 TEODESIAN
         [BUG FIXES]
         - Fix issue on legacy chrome/driver with get/set window pos by forcing fallback to JSONWire methods.

+ 1 - 1
dist.ini

@@ -1,5 +1,5 @@
 name = Selenium-Remote-Driver
-version = 1.23
+version = 1.24
 author = George S. Baugh <george@troglodyne.net>
 author = Aditya Ivaturi <ivaturi@gmail.com>
 author = Daniel Gempesaw <gempesaw@gmail.com>

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

@@ -202,7 +202,7 @@ sub get_params {
     #map: class, class_name, id, name, link = 'css selector'
     if ($args->{using} && $args->{value}) {
         $data->{payload}->{using} = 'css selector'            if grep {$args->{using} eq $_ } ('id', 'class name', 'name');
-        $data->{payload}->{value} = "#$args->{value}"         if $args->{using} eq 'id';
+        $data->{payload}->{value} = "[id='$args->{value}']"   if $args->{using} eq 'id';
         $data->{payload}->{value} = ".$args->{value}"         if $args->{using} eq 'class name';
         $data->{payload}->{value} = "[name='$args->{value}']" if $args->{using} eq 'name';
     }

+ 1 - 1
t/01-webdriver3.t

@@ -237,7 +237,7 @@ SPEC_PARAMS: {
     is_deeply($obj->get_params($args),$expected,"get_params: implicit_wait substitution works");
 
     delete $args->{text};
-    $expected->{payload}{value} = "#whee";
+    $expected->{payload}{value} = "[id='whee']";
     is_deeply($obj->get_params($args),$expected,"get_params: id css substitution works");
 
     $args->{using} = 'class name';