1

Following code worked well in the past. After some days, I try to run it again but it throws such error.

using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Support.UI;

public static ChromeDriver driver;

protected void initDriver(string userDataPath) {
            var driverService = ChromeDriverService.CreateDefaultService(AppDomain.CurrentDomain.BaseDirectory);
            ChromeOptions options = new ChromeOptions();
            driverService.HideCommandPromptWindow = true;
            //options.AddArguments("--headless");
            options.AddArguments("--no-sandbox");
            options.AddArguments("disable-extensions");
            options.AddArguments("--start-minimized");

            driver = new ChromeDriver(driverService, options, TimeSpan.FromSeconds(10*60));

}

Error:

OpenQA.Selenium.WebDriverException: 'Cannot start the driver service on http://localhost:60623/'

halfer
  • 19,471
  • 17
  • 87
  • 173
Thomas Bob
  • 11
  • 4

1 Answers1

0

When the service start the only things executed are a process with the driver service and an api call to that service.
The problems that can rise could be:

  • you can't execute the process, because the executable is not reachable
    • executable not there
    • wrong permissions
  • some configurations are preventing you from executing successfully the api call and reach http://localhost:60623/
    • proxy settings (adding NO_PROXY environment variable excluding localhost might help)
    • firewall settings
    • port already used
Giulio Caccin
  • 2,696
  • 6
  • 33
  • 52