Created
October 29, 2019 15:50
-
-
Save JasonCrowe/148a02abc20b69a54b672b30110447b5 to your computer and use it in GitHub Desktop.
Sample code to show how to create tabs and change between them.
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
window1 = driver.current_window_handle | |
driver.execute_script('''window.open("https://gmail.com","_blank");''') | |
window2 = [w for w in driver.window_handles if w != window1][0] | |
driver.switch_to.window(window2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment