Best practices for WebDriver
When you navigate to a page, you have three options: you can open the page in a new tab, a new window or the current tab using target browser instance
When you are working with web applications, you are faced with multiple window instances. You can achieve your goals by using the auto switch windows built-in setting and the switch window built-in action.
When you open a new window instance and the auto switch window mode is on, the focus will be shifted to the newly opened window instance. However, when the auto switch window mode is off, the focus will stay in the current window instance. In the event that you want to interact with the newly opened window instance, you are required to explicitly use the switch window built-in action.
In a web page with multiple frames, you have to switch the focus to the frame containing the element before locating the element. Needless to say that TestArchitect is capable of switching frames automatically.
Also it provides you with built-in actions to move the focus among frames:
- switch frame by path: to switch the focus to the target frame defined by frame path.
- switch frame by destination: to switch the focus back to the parent frame of the current one or the main frame (default content).
While you are testing a web application, one or multiple popups may be triggered.
There are three actions to handle popups.