0

I've just updated the chromedriver.exe file on my server (to version 89.0), and I've now this error happening:

[17104] OpenQA.Selenium.WebDriverException: unknown error: Chrome failed to start: crashed.
[17104]   (unknown error: DevToolsActivePort file doesn't exist)
[17104]   (The process started from chrome location C:\Program Files (x86)\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.) 
[17104]    at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) 
[17104]    at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) 
[17104]    at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) 
[17104]    at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) 
[17104]    at OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout) 

The code is:

 var options = new ChromeOptions();
 options.AddArguments("--headless");
 using (ChromeDriver chromeDriver = new ChromeDriver(ChromeDriverService.CreateDefaultService(), options, TimeSpan.FromSeconds(180)))
 { ..... }
            

This error happens from an ASP.NET website, but not from a .exe app; and this is the same code running. I don't understand what happens (and it worked with the previous chromedriver file)

EDIT

I've downloaded Chrome v87.0 and the matching chromedriver, and it works now using: ChromeDriverService.CreateDefaultService("C:\chrome87-win"). Something is definitely wrong with v89....

Greg Burghardt
  • 17,900
  • 9
  • 49
  • 92
jcmag
  • 239
  • 1
  • 3
  • 14
  • Which version of Chrome browser are you running when executing this through the ASP.NET web site? – Greg Burghardt Mar 05 '21 at 16:52
  • Is your ASP.NET web site running on Windows, I presume? There is another question, but it is related to running a Java web site on Linux. Not sure if it will help: [WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser](https://stackoverflow.com/q/50642308/3092298). – Greg Burghardt Mar 05 '21 at 17:10
  • @GregBurghardt I have Chrome v89.0 installed on my server – jcmag Mar 05 '21 at 17:28
  • 1
    I've downloaded Chrome v87.0 and the matching chromedriver, and it works now using: ChromeDriverService.CreateDefaultService("C:\\chrome87-win"). Something is definitely wrong with v89.... – jcmag Mar 05 '21 at 21:08
  • You could answer your own question. You might not be the only person who runs into this issue. – Greg Burghardt Mar 05 '21 at 21:21

1 Answers1

0

I faced the same problem when run chromedriver on my server. After adding the following arguments to chrome options, it works fine. Based on the question: WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser

ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized"); // open Browser in maximized mode
options.addArguments("disable-infobars"); // disabling infobars
options.addArguments("--disable-extensions"); // disabling extensions
options.addArguments("--disable-gpu"); // applicable to windows os only
options.addArguments("--disable-dev-shm-usage"); // overcome limited resource problems
options.addArguments("--no-sandbox"); // Bypass OS security model