WebDriver\Session::window PHP Method

window() public method

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 | Session
return WebDriver\Window | Session
    public function window()
    {
        // close current window
        if (func_num_args() === 0) {
            $this->curl('DELETE', '/window');
            return $this;
        }
        // set focus
        $arg = func_get_arg(0);
        // window handle or name attribute
        if (is_array($arg)) {
            $this->curl('POST', '/window', $arg);
            return $this;
        }
        // chaining
        return new Window($this->url . '/window', $arg);
    }

Usage Example

Esempio n. 1
0
 /**
  * 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));
 }
All Usage Examples Of WebDriver\Session::window