/**
  * Simulate typing into an element, which may set its value.
  *
  * @param mixed $value The data to be typed.
  * @return RemoteWebElement The current instance.
  */
 public function sendKeys($value)
 {
     $local_file = $this->fileDetector->getLocalFile($value);
     if ($local_file === null) {
         $params = array('value' => WebDriverKeys::encode($value), ':id' => $this->id);
         $this->executor->execute(DriverCommand::SEND_KEYS_TO_ELEMENT, $params);
     } else {
         $remote_path = $this->upload($local_file);
         $params = array('value' => WebDriverKeys::encode($remote_path), ':id' => $this->id);
         $this->executor->execute(DriverCommand::SEND_KEYS_TO_ELEMENT, $params);
     }
     return $this;
 }
Exemplo n.º 2
0
 /**
  * Send keys to active element
  * @param string|array $keys
  * @return $this
  */
 public function sendKeys($keys)
 {
     $this->executor->execute(DriverCommand::SEND_KEYS_TO_ACTIVE_ELEMENT, array('value' => WebDriverKeys::encode($keys)));
     return $this;
 }
Exemplo n.º 3
0
 /**
  * Send keys to active element
  *
  * @param $keys
  * @return $this
  */
 public function sendKeys($keys) {
   $this->executor->execute('sendKeys', array(
     'value' => WebDriverKeys::encode($keys),
   ));
   return $this;
 }
Exemplo n.º 4
0
 /**
  * Simulate typing into an element, which may set its value.
  *
  * @param mixed $value The data to be typed.
  * @return WebDriverElement The current instance.
  */
 public function sendKeys($value) {
   $params = array(
     'value' => WebDriverKeys::encode($value),
     ':id'   => $this->id,
   );
   $this->executor->execute('sendKeysToElement', $params);
   return $this;
 }