/** * 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"); } }
/** * 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(); }
/** * 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']); }
/** * 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(); }
/** * Removes all current cookies */ public function deleteAllCookies() { $command = new Commands\Command($this->_driver, 'clear_cookies'); $command->execute(); }
/** * 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']; }