Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Description: This command switches to another window identified by a unique popup text, handle index (0,1,2) or main window. Please note that Locator-based commands will switch window to the Locator-defined window. Use this command to switch window for commands like EXECUTE_JAVASCRIPT or with popups that are automatically displayed. Switch Duration parameter is used to override the default behavior of locator-based elements. Without using this parameter, the locator-based commands will switch window to the windows defined by the locator. If the whole test case option is used for this new parameter, the locator-based commands will not switch to the window defined by the locator but instead will continue using the window from this command throughout the rest of the test case or until another Switch_Window command is issued with the Default option.

To guarantee switching to a specific window, after you navigate to that window, create a step with Switch_Window command, select Handler Index and use the number to assign the window with this number (number must not be more than the number of open windows).

Usage Scenarios:

A- Suppose we want to open Reference app on 3 windows and switch from the 3rd window to the second and then to the main window.

Procedure: 1. Define a Goto_URL step as your starting point and two steps with Execute_Javascript for the navigation of the second and third windows using the code:

window.open("https://reference.subject-7.com");

2. After each navigation step, add a step with Switch_Window command, select Handle Index option and enter the number to assign the windows. For example, the first tab will be 0, the second tab will be 1 and the third tab will be 2.

3. At the end, add 3 steps with Switch_Window command which will perform the actual switching between tabs to make sure that the numbers assigned are correct. Your steps will look like this:

  • No labels