- Print
- DarkLight
Steps to open and switch windows
Open a new window
To open a new window and go to a specific URL, you need to add an Open Window step.
How to add an Open Window step
There are two ways to add an Open Window step:
- While recording, add a Go To URL step using the Autify Recorder (select the Open in new window option).
- On the Scenario Edit page, click [Insert Step] and select [Open Window Step].
Return to the original window
To return to the original window after recording in the new window, perform the action that goes back to the original window and then perform any action in that window. This will add either the Switch To Initial Window step or the Switch To Step N's Window step.
Switching tabs in the same window
If you want to open or switch tabs in the same window, you need to add a Switch To Window step.
How to add a Switch To Window step
You can't add a Switch To Window step from the Scenario Edit Page, so you must create it during recording. The step is automatically added during recording when you click on the element that triggers a new tab to open or perform an action that switches tabs.
There are three types of step that can switch tabs.
Switch To New Window
This step is created when a new tab is opened by clicking a link or button.
Switch To Initial Window
This step is created when you switch from the current tab to the tab opened in step 1.
This step is also created when you switch from the current window to the window you opened in step 1.
Switch To Step N's Window
This step is created when you switch from the current tab to the tab opened in step N (other than step 1).
This step is also created when you switch from the current window to the window you opened in step N (other than step 1).
This step has a Target window section where you can select which step's window you want to switch to.
Close a window or tab
The Close Window step is automatically added when a window or tab is closed during recording. Also, depending on which window/tab you go to after closing the window, a Switch To Initial Window or Switch to step N's window step is automatically added.
You can't add a Close Window step from the Scenario Edit Page, so you must create it during recording.
Notes
- If there is no Switch To Window step, switching to another window/tab won't work properly, causing the test and local replay to fail.
- If you accidentally delete a Switch To Window step, you can create another Switch to Window step by performing any action at any point and use it instead.
- In a real iOS device environment, the following limitations apply:
- Due to Apple/iOS restrictions, Open Window, Switch To Window and Switch To Step N's Window are not supported. Furthermore, you cannot use a JS Step to click and open a new window since iOS will block such window treating it as an unwanted pop-up.
- Sometimes a Close Window step is created but not necessary (ex. click a button that closes the current tab with a script will create both a Click step and a Close Window), it can occasionally cause an internal error on Chrome or Edge during test execution of the Close Window. However this can be solved by simply manually removing the Close Window