Skip to content

Commit f43edf7

Browse files
committed
Add "New Window" endpoint from W3C spec
1 parent 1a7f82f commit f43edf7

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ WebDriver for Selenium 2
33
This WebDriver client implementation is based on Facebook's [php-webdriver](https://github.com/facebook/php-webdriver/) project by Justin Bishop.
44

55
Distinguishing features:
6-
* Up-to-date with [W3C Candidate Recommendation 08 January 2018](https://w3c.github.io/webdriver/webdriver-spec.html)
6+
* Up-to-date with [WebDriver: W3C Living Document 31 December 2019](https://w3c.github.io/webdriver/)
77
* Up-to-date with [Selenium 2 JSON Wire Protocol](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol) (including WebDriver commands yet to be documented).
88
* In the *master* branch, class names and file organization follow PSR-0 conventions for php 5.3+ namespaces.
99
* Coding style follows PSR-1, PSR-2, and Symfony2 conventions.

lib/WebDriver/Window.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,16 @@ public function getHandle()
6565
? $result['value'][self::WEBDRIVER_WINDOW_ID]
6666
: $result['value'];
6767
}
68+
69+
/**
70+
* New window: /session/:sessionId/window/new (POST)
71+
*
72+
* @return \WebDriver\Session
73+
*/
74+
public function focusWindow($name)
75+
{
76+
$this->curl('POST', '/new');
77+
78+
return $this;
79+
}
6880
}

0 commit comments

Comments
 (0)