3 * Copyright 2011-2017 Anthon Pang. All Rights Reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 * @author Anthon Pang <apang@softwaredevelopment.ca>
20 * @author Fabrizio Branca <mail@fabrizio-branca.de>
26 * WebDriver\Window class
30 * @method array getSize() Get size of the window.
31 * @method void postSize($json) Change the size of the window.
32 * @method array getPosition() Get position of the window.
33 * @method void postPosition($json) Change position of the window.
34 * @method void maximize() Maximize the window if not already maximized.
36 final class Window extends AbstractWebDriver
43 private $windowHandle;
48 protected function methods()
51 'size' => array('GET', 'POST'),
52 'position' => array('GET', 'POST'),
53 'maximize' => array('POST'),
60 protected function obsoleteMethods()
63 'restore' => array('POST'),
72 public function getHandle()
74 return $this->windowHandle;
80 * @param string $url URL
81 * @param string $windowHandle Window handle
83 public function __construct($url, $windowHandle)
85 $this->windowHandle = $windowHandle;
87 parent::__construct($url . '/' . $windowHandle);