Skip to content

Instantly share code, notes, and snippets.

@seleniumgists
Created August 18, 2020 18:56
Show Gist options
  • Save seleniumgists/dd253323c842ed86760fe06fc85c8fef to your computer and use it in GitHub Desktop.
Save seleniumgists/dd253323c842ed86760fe06fc85c8fef to your computer and use it in GitHub Desktop.
generated automatically from #selenium on seleniumhq slack
self.driver.find_element(By.CSS_SELECTOR, "facebook").click()
wait.until(EC.number_of_windows_to_be(2))
for window_handle in driver.window_handles:
if window_handle != original_window:
driver.switch_to.window(window_handle)
break
sleep(10)
wait.until(EC.title_contains("facebook"))
assert "Facebook" in driver.title
self.driver.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment