diff --git a/lib/WebDriver/Session.php b/lib/WebDriver/Session.php index 192c2ac..947be8a 100644 --- a/lib/WebDriver/Session.php +++ b/lib/WebDriver/Session.php @@ -239,6 +239,19 @@ public function deleteCookie($cookieName) return $this; } + /** + * Get window handles : /session/:sessionId/window_handles (GET) + * : /session/:sessionId/window/handles (GET) + * - $session->getWindowHandles() + * + * @return mixed + */ + public function getWindowHandles() { + $result = $this->curl('GET', $this->w3c ? '/window/handles' : '/window_handles'); + + return $result['value']; + } + /** * Get window handle: /session/:sessionId/window (GET) * : /session/:sessionId/window_handle (GET) diff --git a/lib/WebDriver/Window.php b/lib/WebDriver/Window.php index 8883c43..411f15c 100644 --- a/lib/WebDriver/Window.php +++ b/lib/WebDriver/Window.php @@ -75,6 +75,7 @@ public function __construct($url, $windowHandle = null) /** * Get window handle: /session/:sessionId/window (GET) + * : /session/:sessionId/window_handle (GET) * - $session->window($handle)->getHandle() * - $session->window()->getHandle() *