I created some selenium tests which work pretty fine on localhost, but when I deploy the application on appharbor, I'm getting an exception thrown.
This code throws the exception on creating a new instance of InternetExplorerDriver:
var options = new InternetExplorerOptions();
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
Driver = new InternetExplorerDriver(DriverDirectory, options);
Here is the exception:
OpenQA.Selenium.WebDriverException: Cannot start the driver service on http://localhost:35187/
at OpenQA.Selenium.DriverService.Start()
at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
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.IE.InternetExplorerDriver..ctor(String internetExplorerDriverServerDirectory, InternetExplorerOptions options)
...
Could you please advice what could be the reason and is there any way to solve it?
Adding to Niels answer, sometimes you have to download the .exe file of IE and specify it's path in the webdriver call. If you have selenium drivers installed previously i.e. during installation then it automatically searches for the drivers. Or you have to download explicitly and mention the path to IE .exe file.
To download .exe file,visit the link http://docs.seleniumhq.org/download/
The port 333 specified for the InternetExplorerDriverService falls within the well-known-port-numbers range:
On most systems, a well-known port number can only be used by a system (root) process or by a program run by a privileged user. Allow the driver service to select its own port by not specifying one explicitly, or provide an available port.
Check a couple of things:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With