SeleniumVBA icon indicating copy to clipboard operation
SeleniumVBA copied to clipboard

Chrome Driver throws error when trying to open new tab in Incognito mode

Open GCuser99 opened this issue 2 years ago • 3 comments

Steps to reproduce:

    driver.StartChrome

    driver.OpenBrowser incognito:=True

    driver.NavigateTo "https://www.wikipedia.org/"
    driver.Wait 1000
    
    driver.Windows.SwitchToNew windowType:=svbaTab  'error happens here

Above results in "Failed to open new tab - no browser is open".

It doesn't happen with Edge - only Chrome.

Look similar to this bug report - I will need to report same to the Chrome Driver team...

EDIT: I submitted bug report here

EDIT: As of March, 2023, the same issue is happening for EdgeDriver as well. See bug report here.

GCuser99 avatar Jan 04 '23 00:01 GCuser99

I can confirm all

6DiegoDiego9 avatar Jan 04 '23 20:01 6DiegoDiego9

The Chrome and Edge WebDriver teams seem to be VERY SLOW fixing bugs. Here is a work-around until the bug is fixed:

'In Edge/Chrome, creating new windowType:=svbaTab while using incognito mode will throw an error
'instead of this:
'driver.Windows.SwitchToNew windowType:=svbaTab  'error happens here
'use this:
driver.ExecuteScript "window.open('', '_blank')" 'creates the new tab
driver.Windows.SwitchToByUrl("about:blank") 'switches to new tab

GCuser99 avatar Jun 01 '24 20:06 GCuser99

I confirm that your workaround works on my system too

6DiegoDiego9 avatar Jun 02 '24 13:06 6DiegoDiego9