Method GetWindow
GetWindow(IWindowSelector, WindowMatchExpression)
Retrieves a window that matches the specified windowMatchExpression.
Unlike FindWindow(IWindowSelector, WindowMatchExpression), this method directly throws an exception if the window is not found.
For more information, see Window Match Expressions wiki
Declaration
public static IWindowHandle GetWindow(this IWindowSelector windowSelector, WindowMatchExpression windowMatchExpression)
Parameters
| Type | Name | Description |
|---|---|---|
| IWindowSelector | windowSelector | The window selector instance used to locate the window. |
| WindowMatchExpression | windowMatchExpression | The expression describing the target window. |
Returns
| Type | Description |
|---|---|
| IWindowHandle | The matching window handle. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown if no window matching the specified expression is found. |