Close Window
The Close Window command of the WebDriver API closes the current top-level browsing context (window or tab) and returns with the list of currently open WebWindow
s. If it is the last window that is being closed, the WebDriver session will implicitly be deleted. Subsequent commands after the session is ended will therefore cause invalid session ID errors.
Safe to Use
Close Window
is not safe to use.
It’s supported by 33% of global browsers.
Browsers
Version Breakdown
Full Support
To enable Chromium support, include {"goog:chromeOptions": {"w3c": true}}
in the capabilities. This is only partially supported.
No Support
Full Support
To enable Chromium support, include {"goog:chromeOptions": {"w3c": true}}
in the capabilities. This is only partially supported.
Full Support
No Support
Full Support
No Support
No Support
No Support
No Support
No Support
No Support
No Support
See Also
- Switch To Window command
- Get Window Handle command
- Get Window Handles command