Chrome Driver throws error when trying to open new tab in Incognito mode
GCuser99 opened this issue · comments
Mike commented
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.
Diego commented
I can confirm all
Mike commented
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
Diego commented
I confirm that your workaround works on my system too