Selenium WebDriver 4

Open and switch to a new tab

Medium70 pts~25 min
  • Window handles
  • Tabs
Practice app · Help Center

Links and buttons that open new tabs and windows.

Test URL
/lab/selenium-open-and-switch-to-a-new-tab

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Open the release notes in a new tab, switch the driver to it and verify its content.

Your task

  1. 1Store the current window handle, then click #open-tab (a target=_blank link).
  2. 2Wait until two window handles exist.
  3. 3Switch to the handle that is not the original one.
  4. 4Assert the title is “Release notes | Help Center”, #child-heading reads “Release notes” and #child-message contains “Version 4.2 is live”.

Acceptance criteria

  • Window handles are read and the driver switches window
  • At least 3 assertions pass in the new tab

Selenium WebDriver 4 · Selenium · Frames, windows & tabs