Skip to main content

[Windows] Switch To Window

Description

Find and attach the opening application window that describes by the given windows object to the working WindowsDriver session on the current desktop.

This keyword should be used when the main application window has been closed and replaced by another window, the application has multiple working windows (We can switch among these windows), or we already have an opened application and need to switch to without reopening.

Keyword name: switchToWindow

Parameters

Parameter Parameter TypeRequiredDescription
windowsObjectWindowsTestObjectYesAn object that describes locator and locator strategy to find the opening application.
flowControlFailureHandlingOptionalSpecify failure handling schema to determine whether the execution should be allowed to continue or stop.

Returns

Parameter TypeDescription
WindowsDriverThe WindowsDriver after Katalon Studio switches successfully.
StepFailedExceptionThrows an error if Katalon Studio could not find any window that matches with the given windows object.

Example

Windows.switchToWindow(findWindowsObject('Object Repository/Window'))