Window Commands

Microsoft Edge supports the following window-related WebDriver commands:

HTTP RequestCommands
/session/{sessionId}/windowClose Window, Switch To Window
/session/{sessionId}/window_handleGet Window Handle
/session/{sessionId}/window_handlesGet Window Handles

Close Window

NameClose Window
DescriptionCloses the current window.
SpecW3C WebDriver, JSON Wire Protocol
HTTP RequestDELETE /session/{sessionId}/window

JSON Parameters
None.

JSON Response Value

{
    "sessionId": "{sessionId}",
    "status": 0,
    "value": null
}

Switch To Window

NameSwitch To Window
DescriptionChanges focus to another window.
SpecW3C WebDriver, JSON Wire Protocol
HTTP RequestPOST /session/{sessionId}/window

JSON Parameters
None.

JSON Response Value

{
    "name": "{windowHandle}"
}

Get Window Handle

NameClick
DescriptionRetrieves the current window handle.
SpecW3C WebDriver, JSON Wire Protocol
HTTP RequestGET /session/{sessionId}/window_handle

JSON Parameters
None.

JSON Response Value

{
    "sessionId": "{sessionId}",
    "status": 0,
    "value": "{windowHandle}"
}

Get Window Handles

NameGet Window Handles
DescriptionRetrieves the list of all window handles available to the session.
SpecW3C WebDriver, JSON Wire Protocol
HTTP RequestPOST /session/{sessionId}/element/{elementId}/value

JSON Parameters
None.

JSON Response Value

{
    "sessionId": "{sessionId}",
    "status": 0,
    "value": [
        "{windowHandleOne}",
        "{windowHandleTwo}"
    ]

}