예제 #1
0
 /**
  * Sends keys to the alert.
  * @param String $string
  */
 public function sendKeys($string)
 {
     if (is_string($string)) {
         $params = array('text' => $string);
         $command = new Commands\Command($this->_driver, 'set_alert_text', $params);
         $command->execute();
     } else {
         throw new \Exception("Value must be a string");
     }
 }
예제 #2
0
 /**
  * Set's Async Script timeout
  * @param Integer $milliseconds
  */
 public function setScriptTimeout($milliseconds)
 {
     $params = array('ms' => $milliseconds);
     $command = new Commands\Command($this->_driver, 'async_script_timeout', $params);
     $command->execute();
 }
예제 #3
0
 /**
  * Gets current window's position
  * @return Array
  */
 public function getPosition()
 {
     $command = new Commands\Command($this->_driver, 'get_window_position', null, array('window_handle' => 'current'));
     $results = $command->execute();
     return $results['value'];
 }
 /**
  * Finds the active element on the page and returns it
  * @return WebElement
  */
 public function activeElement()
 {
     $command = new Commands\Command($this->_driver, 'active_element');
     $results = $command->execute();
     return new WebElement($this->_driver, $results['value']['ELEMENT']);
 }
예제 #5
0
 /**
  * Navigates to specified url
  * @param String $url
  */
 public function to($url)
 {
     $params = array('url' => $url);
     $command = new Commands\Command($this->_driver, 'get_url', $params);
     $command->execute();
 }
예제 #6
0
 /**
  * Removes all current cookies
  */
 public function deleteAllCookies()
 {
     $command = new Commands\Command($this->_driver, 'clear_cookies');
     $command->execute();
 }
예제 #7
0
 /**
  * Get element's coordinates after scrolling
  * @return Array
  */
 public function getLocationOnScreenOnceScrolledIntoView()
 {
     $command = new Commands\Command($this->_driver, 'element_location_view', null, array('element_id' => $this->_elementId));
     $results = $command->execute();
     return $results['value'];
 }