Best practices for WebDriver
Navigating to a page in a new tab/window
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
Handling multiple window instances
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.
- click popup: to click a button in a popup.
- enter value in popup: to write text in a field in a popup, and click OK.
- copy popup message: to obtain the message in a popup and store it in a variable.