Could you help me with an advice? I'm doing some QA test and am testing a site. During the process, one by one windows in Chrome open and I'm trying to switch between these windows in Chrome. I don't succeed to switch to the third window. Can you help please? I'm using Pycharm and Selenium framework.
Here is the part of the Code where I ask your assistance:
second_login= webdriver.Ie()
second_login.maximize_window()
second_login.get('http://google.com')
print(second_login.title)
second_login.find_element_by_id('id1').click()
tab_now = second_login.window_handles[1]
second_login.switch_to.window(tab_now)
print(second_login.title)
log = second_login.find_element_by_id('id2')
log.send_keys('admin1')
pas=second_login.find_element_by_id('id3')
pas.send_keys('pas1')
logbutton=second_login.find_element_by_class_name('LoginButton')
logbutton.click()
second_login.implicitly_wait(3)
tab_after = second_login.window_handles[-1]
second_login.switch_to.window(tab_after)
second_login.find_element_by_id('id4').click()
print(second_login.title)
Thank you.