C# OpenQA.Selenium.WebDriverException: 'unknown error: Failed to create Chrome process.'

0

Information

Hello mates! Several days ago, I've ran into issue with Selenium and that is to be exact the error in the title. I have been trying to resolve this issue myself for some days now with no luck at all. Chrome is being run from external file, when I try to open manually, it works. If I try to run the driver from the default location, it works. I've tried different versions of Selenium with no luck and different versions of Chrome.

Expected results

ChromeDriver will execute chrome.exe.

Actual results

ChromeDriver fails to start chrome.exe for unknown reason. CLI Picture

Code

ChromeDriver driver = new ChromeDriver(new ChromeOptions { BinaryLocation = Path.Combine(Environment.CurrentDirectory, @"GoogleChromePortable") });

Exception details

OpenQA.Selenium.WebDriverException
  HResult=0x80131500
  Message=unknown error: Failed to create Chrome process.
  Source=WebDriver
  StackTrace:
   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 OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeOptions options)
   at Self_Contained.Program.Main(String[] args) in *:\*\*\SFC\Program.cs:line 11
c#
selenium
google-chrome
selenium-webdriver
selenium-chromedriver
asked on Stack Overflow Jul 21, 2020 by Matthew

1 Answer

0

After hours of research I found somewhere that excluding chrome.exe may lead to this issue. I added chrome.exe to the binary path and voilĂ  it is working.

answered on Stack Overflow Jul 22, 2020 by Matthew

User contributions licensed under CC BY-SA 3.0