Skip to content

Latest commit

 

History

History
102 lines (83 loc) · 3.04 KB

File metadata and controls

102 lines (83 loc) · 3.04 KB
ms.assetid description title author ms.author ms.date ms.topic ms.prod keywords
3658497a-6dbe-4864-80e6-8228e9c141d5
Learn useful information about window-related commands for the WebDriver API.
Webdriver commands - Window
erikadoyle
edoyle
02/08/2017
article
microsoft-edge
edge, web development, html, css, javascript, developer

Window Commands

Microsoft Edge supports the following window-related WebDriver commands:

HTTP Request Commands
/session/{sessionId}/window Close Window, Switch To Window
/session/{sessionId}/window_handle Get Window Handle
/session/{sessionId}/window_handles Get Window Handles

Close Window

Name Close Window
Description Closes the current window.
Spec W3C WebDriver, JSON Wire Protocol
HTTP Request DELETE /session/{sessionId}/window

JSON Parameters None.

JSON Response Value

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

Switch To Window

Name Switch To Window
Description Changes focus to another window.
Spec W3C WebDriver, JSON Wire Protocol
HTTP Request POST /session/{sessionId}/window

JSON Parameters None.

JSON Response Value

{
    "name": "{windowHandle}"
}

Get Window Handle

Name Click
Description Retrieves the current window handle.
Spec W3C WebDriver, JSON Wire Protocol
HTTP Request GET /session/{sessionId}/window_handle

JSON Parameters None.

JSON Response Value

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

Get Window Handles

Name Get Window Handles
Description Retrieves the list of all window handles available to the session.
Spec W3C WebDriver, JSON Wire Protocol
HTTP Request POST /session/{sessionId}/element/{elementId}/value

JSON Parameters None.

JSON Response Value

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

}