Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/web/webdriver/commands/new_window/index.md
6546 views
---
title: New Window slug: Web/WebDriver/Commands/New_Window browser-compat: webdriver.commands.NewWindow
---

{{QuickLinksWithSubpages("/en-US/docs/Web/WebDriver/Commands")}}

The New Window command of the WebDriver API opens a new top-level browsing context of type window or tab, and returns with a dictionary containing the handle of the new WebWindow and its created type. If the requested type cannot be created by the browser, the alternative type will be tried to create.

Syntax

MethodURI template
POST/session/{session id}/window/new

URL parameters

  • session id

    • : Identifier of the session.

Payload

The input is an object:

  • type

    • : Requested type of top-level browsing context.

Response

The response payload is an object:

  • handle

  • type

    • : The created type of top-level browsing context.

Errors

Example

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also