class LegacyWindow
WebDriver\LegacyWindow class
@package WebDriver
@method void maximize() Maximize the window if not already maximized. @method array getPosition() Get position of the window. @method void postPosition($json) Change position of the window. @method array getSize() Get size of the window. @method void postSize($json) Change the size of the window.
Hierarchy
- class \WebDriver\AbstractWebDriver
- class \WebDriver\LegacyWindow extends \WebDriver\AbstractWebDriver
Expanded class hierarchy of LegacyWindow
1 file declares its use of LegacyWindow
- Selenium2Driver.php in vendor/
lullabot/ mink-selenium2-driver/ src/ Selenium2Driver.php
File
-
vendor/
lullabot/ php-webdriver/ lib/ WebDriver/ LegacyWindow.php, line 25
Namespace
WebDriverView source
class LegacyWindow extends AbstractWebDriver {
/**
* @var string
*/
private $windowHandle;
/**
* {@inheritdoc}
*/
protected function methods() {
return array(
// Legacy JSON Wire Protocol
'maximize' => array(
'POST',
),
'position' => array(
'GET',
'POST',
),
'size' => array(
'GET',
'POST',
),
);
}
/**
* {@inheritdoc}
*/
protected function obsoleteMethods() {
return array(
'restore' => array(
'POST',
),
);
}
/**
* Constructor
*
* @param string $url
* @param string|null $windowHandle
*/
public function __construct($url, $windowHandle = null) {
parent::__construct($url . '/' . $windowHandle);
$this->windowHandle = $windowHandle;
}
/**
* Get window handle: /session/:sessionId/window_handle (GET)
* - $session->window($handle)->getHandle()
* - $session->window()->getHandle()
*
* @return string
*/
public function getHandle() {
if (!$this->windowHandle) {
$result = $this->curl('GET', '_handle');
$this->windowHandle = $result['value'];
}
return $this->windowHandle;
}
/**
* Close window: /session/:sessionId/window (DELETE)
*
* @return mixed
*/
public function close() {
$result = $this->curl('DELETE', '');
return $result['value'];
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
AbstractWebDriver::$curlService | private | property | Curl service | ||
AbstractWebDriver::$transientOptions | private | property | Transient options | ||
AbstractWebDriver::$url | protected | property | URL | ||
AbstractWebDriver::assertSerializable | private | function | Sanity check | ||
AbstractWebDriver::curl | protected | function | Curl request to webdriver server. | ||
AbstractWebDriver::getCurlService | public | function | Get curl service | ||
AbstractWebDriver::getRequestMethod | private | function | Get default HTTP request method for a given WebDriver command | ||
AbstractWebDriver::getTransientOptions | public | function | |||
AbstractWebDriver::getURL | public | function | Returns URL to Selenium server | ||
AbstractWebDriver::offsetGet | private | function | Extract value from result | ||
AbstractWebDriver::setCurlService | public | function | Set curl service | ||
AbstractWebDriver::setTransientOptions | public | function | Set transient options | ||
AbstractWebDriver::__call | public | function | Magic method that maps calls to class methods to execute WebDriver commands | 1 | |
AbstractWebDriver::__toString | public | function | Magic method which returns URL to Selenium server | ||
LegacyWindow::$windowHandle | private | property | |||
LegacyWindow::close | public | function | Close window: /session/:sessionId/window (DELETE) | ||
LegacyWindow::getHandle | public | function | Get window handle: /session/:sessionId/window_handle (GET) | ||
LegacyWindow::methods | protected | function | Return array of supported method names and corresponding HTTP request methods | Overrides AbstractWebDriver::methods | |
LegacyWindow::obsoleteMethods | protected | function | Return array of obsolete method names and corresponding HTTP request methods | Overrides AbstractWebDriver::obsoleteMethods | |
LegacyWindow::__construct | public | function | Constructor | Overrides AbstractWebDriver::__construct |