/**
  * 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;
 }
Beispiel #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;
 }