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)
    window_after = self.driver.window_handles[1]

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.

  • It seems to be that you are opening two browser instances when you run this test/the code. What does your driver initialization look like? Not for the test itself, but overall. – Brian Sep 10 '19 at 21:53
  • 1
    I solved this issue. The problem was that Windows Defender wanted to reset my settings. So I had two windows by default, "Settings" and "data:,". fixyourbrowser.com/removal-instructions/… – rodut Sep 11 '19 at 15:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.