SwitchTo

SwitchTo command is used to switch to the specified window and iframe.

For switching to an iframe, select SWITCHTO command from the action drop down, select desired Screen name and Element (here element could be any element of the iframe) and leave the parameter section blank as shown below:

Here, frame_username (in the above snapshot) is an element inside the iframe to which we want to switch the control. After completing this step, test step will look as below:

Similarly, if there are multiple frames and user has to switch to specific frame then user can use specific index of that frame e.g. 1, 2, 3 etc. as shown below:

For switching to another window, User has to select SWITCHTO command from the action drop down, leave Screen blank, type ” child “ in the Element key and leave the parameter section blank as shown below:

The above step will switch the control from main window to child window. Now in order to switch the control back to main window, user has to use “main” keyword in the element key as shown below:

Was this page helpful?