Selenium WebDriver 4

Manage multiple windows by handle

Hard120 pts~45 min
  • Window handles
  • Popups
Practice app · Help Center

Links and buttons that open new tabs and windows.

Test URL
/lab/selenium-manage-multiple-windows-by-handle

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

Objective

Open a tab and a popup window, identify each by handle and title, and return to the main window.

Your task

  1. 1Save the main handle, click #open-tab and then #open-window (the driver stays on the main window).
  2. 2Wait for three handles, then switch to each one and record its title.
  3. 3Assert the titles “Release notes | Help Center” and “Live chat | Help Center” are both present.
  4. 4Switch to the Live chat window and assert #child-heading reads “Live chat”.
  5. 5Switch back to the main handle, click #mark-read and assert #main-status reads “All caught up”.

Acceptance criteria

  • Handles are iterated and switched by value
  • #main-status shows “All caught up” in the main window
  • At least 3 assertions pass

Selenium WebDriver 4 · Selenium · Frames, windows & tabs