Last active
December 16, 2015 16:58
-
-
Save BartlomiejSkwira/5466609 to your computer and use it in GitHub Desktop.
Assert new window has been opened in Selenium and switch driver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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