GCuser99 / SeleniumVBA

A comprehensive Selenium wrapper for browser automation developed for MS Office VBA running in Windows
MIT License
82 stars 16 forks source link

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

Open GCuser99 opened 1 year ago

GCuser99 commented 1 year ago

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.

6DiegoDiego9 commented 1 year ago

I can confirm all

GCuser99 commented 3 months ago

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
6DiegoDiego9 commented 3 months ago

I confirm that your workaround works on my system too