window methods: /session/:sessionId/window (POST, DELETE)
- $session->window() - close current window
- $session->window($name) - set focus
- $session->window($window_handle)->method() - chaining
public window ( ) : WebDriver\Window | |
||
return | WebDriver\Window | |
/** * Resize current window * * Example: * ``` php * <?php * $I->resizeWindow(800, 600); * * ``` * * @param int $width * @param int $height * @author Jaik Dean <*****@*****.**> */ public function resizeWindow($width, $height) { $this->webDriverSession->window('current')->postSize(array('width' => $width, 'height' => $height)); }
/** * Set the dimensions of the window. * * @param integer $width set the window width, measured in pixels * @param integer $height set the window height, measured in pixels * @param string $name window name (null for the main window) */ public function resizeWindow($width, $height, $name = null) { return $this->wdSession->window($name ? $name : '')->postSize(array('width' => $width, 'height' => $height)); }
/** * {@inheritdoc} */ public function maximizeWindow($name = null) { $this->wdSession->window($name ? $name : 'current')->maximize(); }