Hi,
I'm using Selenium.WebDriver version 4.8.1 and Firefox 110.0.1 in c#.
When I create a FirefoxDriver with this code:
var driver = new FirefoxDriver();
driver.Navigate().GoToUrl("
https://youtube.com/");
I get OpenQA.Selenium.NoSuchWindowException: 'Browsing context has been discarded'.
The firefox window opens but with an empty blank tab (By running firefox with the same command from cmd it also includes content like the firefox logo and search bar). Screenshots of the 2 firefox windows are attached.
The same code works on the same machine with chrome and edge.
I tried to restart, reinstalling firefox with different versions, with and without GeckoDriver ("Selenium.WebDriver.GeckoDriver" Version="0.32.2"), change profile, change BrowserCommunicationPort, etc. but It keeps failing with the same exception.
It only succeeds by opening the firefox by cmd with "--marionette" and using FirefoxDriverService with ConnectToRunningBrowser=true.
What could cause this? What can I do to solve it?
Thanks in advanced