In my ASP.net MVC application, I'm using selenium c# chrome driver for some automation purpose. My application works fine when I run the application through VS. But after hosting application in IIS server following error occurred.
The HTTP request to the remote WebDriver server for URL http://localhost:35756/session timed out after 60 seconds
and some times this error too
Message :The HTTP request to the remote WebDriver server for URL http://localhost:14003/session/39f4131f839af646da1b9855ce8d091b/element/0.6598483585083559-1/click timed out after 60 seconds.
Message :The HTTP request to the remote WebDriver server for URL http://localhost:35756/session timed out after 60 seconds.
StackTrace : at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
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.Chrome.ChromeDriver..ctor(ChromeDriverService service, ChromeOptions options, TimeSpan commandTimeout)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(String chromeDriverDirectory, ChromeOptions options)
at OpenQA.Selenium.Chrome.ChromeDriver..ctor(String chromeDriverDirectory)
Previously this worked for me.but since few days I'm getting this error. Do anyone have an idea to solve this problem?
Part of my code:
try{
ChromeOptions options = new ChromeOptions();
options.AddArguments("--proxy-server=http://192.168.5.62:8095");
options.AddUserProfilePreference("safebrowsing.enabled", true);
options.AddUserProfilePreference("disable-popup-blocking", "true");
options.AddUserProfilePreference("download.default_directory", downPath);
using (var driver = new ChromeDriver(HostingEnvironment.ApplicationPhysicalPath,options))
{
// Go to the home page
//driver.Manage().Timeouts().PageLoad = TimeSpan.FromMinutes(2);
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(30);
}
}
catch (Exception ex)
{
log.Error(ex);
Logger.LogWriter("SITS", ex, "CRIBLogic", "Download");
}
I read several threads regarding this problem. But I'm not found a proper answer