def METHOD_NAME(driver, pages):
    pages.load("xhtmlTest.html")
    current = driver.current_window_handle
    handles = driver.window_handles
    driver.find_element(By.LINK_TEXT, "Open new window").click()
    WebDriverWait(driver, 3).until(EC.new_window_is_opened(handles))
    handles = driver.window_handles
    handles.remove(current)
    driver.switch_to.window(handles[0])
    driver.close()
    with pytest.raises(NoSuchWindowException):
        driver.title
    with pytest.raises(NoSuchWindowException):
        driver.find_element(By.TAG_NAME, "body")