Skip to content

Instantly share code, notes, and snippets.

@AutomatedTester
Created March 3, 2015 17:11
Show Gist options
  • Select an option

  • Save AutomatedTester/3c2c4e4d4e221e507b49 to your computer and use it in GitHub Desktop.

Select an option

Save AutomatedTester/3c2c4e4d4e221e507b49 to your computer and use it in GitHub Desktop.
driver.find_element(By.LINK_TEXT, "cheese")
current_handle = driver.current_window_handle
window_handles = driver.window_handles
for handle in window_handles:
driver.switch_to_handle(handle)
resutl = driver.execute_script('return window.name="name you want")
if result:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment