O'Reilly logo
  • Tara Morrison thinks this is interesting:

from selenium import webdriver
import unittest


class PopupWindowTest(unittest.TestCase):

    URL = "https://rawgit.com/upgundecha/learnsewithpython/master/pages/Config.html"

    def setUp(self)    :
        self.driver = webdriver.Firefox()
        self.driver.get(self.URL)
        self.driver.maximize_window()

    def test_window_popup(self):
        driver = self.driver

        # save the WindowHandle of Parent Browser Window
        parent_window_id = driver.current_window_handle

        # clicking Help Button will open Help Page in a new Popup # Browser Window
        help_button = driver.find_element_by_id("helpbutton")
        help_button.click()
        driver.sw...
            
        
			

From

Cover of Learning Selenium Testing Tools with Python

Note

getting and switching to popup windows