Get-WindowHandle

Retrieve the current window handle.

Powershell

Retrieve the current window handle. Returns: The current window handle. NoSuchWindow - If the currently selected window has been closed.

Syntax

Get-WindowHandle [[-sessionId] ] []

Parameters

name description
sessionId (Optional) The identifier of the session to route the command to.

Examples

Get-WindowHandle

C#

Declaration

System.String OpenQA.Selenium.IWebDriver.CurrentWindowHandle;

Returns:

type description
System.String The current window handle, which is an opaque handle to this.

Examples

driver.CurrentWindowHandle;