Skip to content

Instantly share code, notes, and snippets.

@BartlomiejSkwira
Last active December 16, 2015 16:58
Show Gist options
  • Select an option

  • Save BartlomiejSkwira/5466609 to your computer and use it in GitHub Desktop.

Select an option

Save BartlomiejSkwira/5466609 to your computer and use it in GitHub Desktop.
Assert new window has been opened in Selenium and switch driver
page.driver.browser.window_handles.size == 2
page.within_window page.driver.browser.window_handles.last do
current_path = #...
end
#Simply refocus for current session:
session.driver.browser.switch_to.window(page.driver.browser.window_handles.last)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment