Ever since the latest Chromium update I have been unable to run Selenium on Linux (.NET Core)
Google Chrome is installed on usr/bin/google-chrome
, and I have made sure of it as I have ran it directly from the directory it's stored in.
Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}) on port 32911
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Unhandled Exception: OpenQA.Selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Linux 4.15.0-45-generic x86_64)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
at selenium.Program.Main() in REDACTED
Aborted (core dumped)
I have tried disabling shm, use headless mode, and other recent issues on this topic, but none have worked.
ChromeOptions options = new ChromeOptions();
options.AddArguments("--headless --no-sandbox");
options.AddUserProfilePreference("profile.default_content_setting_values.images", 2);
IWebDriver webDriver = new ChromeDriver(AppDomain.CurrentDomain.BaseDirectory, options);
webDriver.Navigate().GoToUrl(@"file:///login.html");
The expected output is for ChromeDriver not to throw an exception and crash.