I'm having an issue when I try to switch the new opened window. Every time I execute a test case, my chromedriver opens with a window named "data:,". My code:
def test_case(self): reg = Register(self.driver) reg.close_icon() reg.click_register() time.sleep(1) reg.click_privacy_policy() time.sleep(2) window_after = self.driver.window_handles self.driver.switch_to.window(window_after) time.sleep(1) print(self.driver.title)
So I have a page with a link. I click on that link (reg.click_privacy_policy()) and the new page opens in a new window. After this I'm trying to switch to the newly opened window, but it switches to the window named "data:,". This code works perfectly fine when I use geckodriver. So definitely the problem is with this "data:,". How can I get rid of this window? Thanks.
P.S. I'm using the latest versions for Chrome and chromedriver.