I have a situation where I click on a button that opens up a new browser Window. Is there any way to connect to the newly opened window? And work with it, then return back to original browser (first window).
Thank you.
After some thorough investigation on the net I managed to get some of the code working
Currentwindow = driver.window_handles
Likebutton = driver.find_element_by_css_selector(".single_like_button .btn3").click()
newwindow = driver.window_handles
newwindow = list(set(newwindow) - set(Currentwindow))[0]
driver.switch_to.window(newwindow)
driver.find_element_by_id("watch-like").click()
driver.implicitly_wait(5)
driver.close()
Problem is the command driver.implicitly_wait(5) doesn't work for some reason and the page automatically closes which is not something I want.
How do I get it working?