When I click on an input button of a html page, new firefox window is opened.How can I switch between these windows using Selenium in Python? I need this in Python not Java.
Asked
Active
Viewed 754 times
0
-
possible duplicate of [WebDriver switch to new browser opened after click on button](http://stackoverflow.com/questions/9588827/webdriver-switch-to-new-browser-opened-after-click-on-button) – Vikas Ojha Jun 13 '15 at 12:29
-
Thats in Java, I need in Python. – Hunterr Jun 13 '15 at 12:30
-
Have you tried porting the same code to Python? – Vikas Ojha Jun 13 '15 at 12:31
-
Check this as well - http://www.seleniumhq.org/docs/03_webdriver.jsp#moving-between-windows-and-frames – Vikas Ojha Jun 13 '15 at 12:32
-
I did try: for handle in driver.window_handles: driver.switch_to_window('handle') But its not working. – Hunterr Jun 13 '15 at 12:33
-
Could you post your url? – Vikas Ojha Jun 13 '15 at 12:34
-
1Apologies, i passed the handle as string not variable. Works well now. Thank You. – Hunterr Jun 13 '15 at 12:39