I use ChromeDriver to create a Screenschot like
ChromeOptions options = new ChromeOptions();
options.AddArgument("headless");
var driver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), options);
driver.Navigate().GoToUrl("http://192.168.15.104:12347/WebPortal/controlSystemInternal");
driver.Manage().Window.Size = new System.Drawing.Size(1800, 1100);
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(30));
wait.Until(ExpectedConditions.InvisibilityOfElementLocated(By.Id("wait")));
var screenshot = (driver as ITakesScreenshot).GetScreenshot();
screenshot.SaveAsFile("c:\\temp\\screenshot.png");
ChromeDriver.exe locates in the Dicrectory of the executing assembly. This is working great on my developement-environment. But when I run this in the production-environment, I get the Exception
OpenQA.Selenium.WebDriverException: Cannot start the driver service on http://localhost:58266/ bei OpenQA.Selenium.DriverService.Start()
bei OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute) bei OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) bei OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) bei OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) bei OpenQA.Selenium.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout) bei OpenQA.Selenium.Chrome.ChromeDriver..ctor(String chromeDriverDirectory, ChromeOptions options)
The portnumbe in the Exception-Message differs always.
Does anyone have an idea whats going wrong there?