Skip to main content

GUI: Web Switch Window

Description

Web Switch Window transfers focus to a different browser window or tab so that subsequent steps act on the correct page. Use this step when your automation opens multiple windows or tabs — for example, after a link opens a new window — and you need to direct your workflow to a specific one. You can switch by window title, URL, window index, or by searching for a specific element across all open windows. This step is typically needed when you manually drag and drop steps into a workflow; spy-recorded or recorder-built workflows usually handle window focus automatically.

Note

Switch window step is mostly not required when workflow is recorded using spy or recorder. It will be needed if we drag and drop step to workflow. This step can be used if and only if required.

Configurations

Field NameDescription
Step NameName of the step. This name has to be unique in a single workflow.The data type is String and the field is mandatory.
Web Browser NameSelect any one Web Browser Name from the given list.
Note: Select the same Web Browser Name which was selected in Start Browser Step.
Switching OptionsSelect option from list to switch between windows:
- Window List.
- URL.
- Element.
Index
Notes:
Value Field is enabled for Window Title ,URL and Index.
Criteria, Criteria Value, Element Index and Iframe Indices are enabled for Element option.
For detail understanding on switching options, see Switching Options table.
The field is mandatory.
ValueRelevant value for the specified Switching option.
Criteria‘Criteria’ is the criterion to locate elements on Web GUI. GUI Spy can capture it in the Generate Step dialog. Upon Step Generation, it is populated in the step configuration. You may change criteria by choosing from the drop-down list in the ‘Step Generation’ window or step configuration.
Criteria ValueRelevant criteria value has to be specified.
Element Index(Starts with 0)Specify the index of the element you want to locate.
Note: One can also specify First or Last. First, if you want the first element from the located element or specify Last if you want the last element.Default Value: 0.
Iframe IndicesSpecify Iframe Indices value.
Specifying iframe indices ensures that the target element is identified correctly within the nested frame structure. You can provide comma-separated values.For e.g. 0,1,2.
Iframe XpathIframe Xpath is a uniquely generated path that represents the location of an <iframe> or <frame> relative to the top-level window.

Iframe Xpath identifies each frame using a unique attribute such as id, name, or title if available, for example, iframe[@id='mainFrame'].

If no such attributes exist, the frame is identified by its position among sibling frames, like iframe[2] for the second iframe.

For nested structures, each frame is joined in sequence to form a full path. For example, if an element is inside an iframe[@id='outer'], which contains a frameset with a frame[@name='middle'], and that frame contains iframe[@title='inner'], the generated path would be:
iframe[@id='outer'];frame[@name='middle'];iframe[@title='inner'].

Note: If an iframe or frame has no id, name, or title, its origin (i.e., the src URL) will be used as a fallback in the path for unique identification. For example: iframe[@origin='https://example.com'].
Frame IDProvide the current Iframe Id to target a specific iframe to perform the action.
Default Value: frameID

Switching Options

The following table contains the description of each switching option:

Field NameDescription
Window TitleOption can be used when window title is known.
URLIf there are multiple windows or tabs open in the browser with different URLs and you need to navigate to the window having specific URL. Specify URL in the value field.
ElementTries to find the specified element in all open browser windows and stops on the window where this element is found. Criteria to locate element can be specified using criteria and value field.
IndexUse to switch the window base on the window index number provided.
Note: Specify window index in number, for example, 0,1,2, … in Value.