Przeglądaj źródła

actually follow the docu

George S. Baugh 5 lat temu
rodzic
commit
64114d265d
1 zmienionych plików z 10 dodań i 6 usunięć
  1. 10 6
      lib/Selenium/ActionChains.pm

+ 10 - 6
lib/Selenium/ActionChains.pm

@@ -132,9 +132,11 @@ sub key_down {
     if ( defined($element) ) {
         $self->click($element);
     }
-    push @{ $self->actions },
-      sub { $self->driver->general_action( actions => [ { type => 'key', id => 'key', actions => [ { type => 'keyDown', value => $value } ] } ] ) };
-    $self;
+    foreach my $v (@$value) {
+        push @{ $self->actions },
+          sub { $self->driver->general_action( actions => [ { type => 'key', id => 'key', actions => [ { type => 'keyDown', value => $v } ] } ] ) };
+    }
+    return $self;
 }
 
 sub key_up {
@@ -143,9 +145,11 @@ sub key_up {
     if ( defined($element) ) {
         $self->click($element);
     }
-    push @{ $self->actions },
-      sub { $self->driver->$self->driver->general_action( actions => [ { type => 'key', id => 'key', actions => [ { type => 'keyUp', value => $value } ] } ] ) };
-    $self;
+    foreach my $v (@$value) {
+        push @{ $self->actions },
+          sub { $self->driver->$self->driver->general_action( actions => [ { type => 'key', id => 'key', actions => [ { type => 'keyUp', value => $v } ] } ] ) };
+    }
+    return $self;
 }
 
 sub send_keys {