1

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[1]
    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.

  • 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 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 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.