diff --git a/lib/WebDriver/LegacyWindow.php b/lib/WebDriver/LegacyWindow.php index e641b9e..7c06049 100644 --- a/lib/WebDriver/LegacyWindow.php +++ b/lib/WebDriver/LegacyWindow.php @@ -82,4 +82,16 @@ public function getHandle() return $this->windowHandle; } + + /** + * Close window: /session/:sessionId/window (DELETE) + * + * @return mixed + */ + public function close() + { + $result = $this->curl('DELETE', ''); + + return $result['value']; + } } diff --git a/lib/WebDriver/Window.php b/lib/WebDriver/Window.php index b6d95a8..56e77f4 100644 --- a/lib/WebDriver/Window.php +++ b/lib/WebDriver/Window.php @@ -93,4 +93,16 @@ public function getHandle() return $this->windowHandle; } + + /** + * Close window: /session/:sessionId/window (DELETE) + * + * @return mixed + */ + public function close() + { + $result = $this->curl('DELETE', ''); + + return $result['value']; + } }