Member-only story
Selenium Workbook #49: View Resources on Booking (With Multiple Browser Tabs)
Work with multiple browser tabs in Selenium WebDriver.
3 min readOct 19, 2024
This article is one of the “Web Test Automation Workbook” series, a set of bite-sized exercises (typically 15–20 mins). A practical and satisfying way to learn web test automation with Selenium WebDriver.
Learning Objectives
- Switch browser tab
- Close a browser tab
Test Case 49
Test Design
This continues from Exercise #48.
You must have seen this scenario before: clicking a link that opens in a new browser tab. This is controlled by HTML.
<a href="https://...." target="_blank">ObiWan Kenobi</a>
Now we have two browser tabs.
- Which browser tab is the current
driver
is “pointing to”?
Print out the driver
‘s current web address, in TestWise Debugging mode to find out.