В моем приложении ASP.net MVC я использую драйвер selenium c # chrome для некоторых целей автоматизации.Мое приложение работает нормально, когда я запускаю приложение через VS.Но после размещения приложения на сервере IIS произошла следующая ошибка.
HTTP-запрос к удаленному серверу WebDriver для URL http://localhost:35756/session истекает через 60 секунд
, а иногда и эта ошибка
Сообщение: HTTP-запрос к удаленному серверу WebDriver для URL http://localhost:14003/session/39f4131f839af646da1b9855ce8d091b/element/0.6598483585083559-1/click истек через 60 секунд.
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)
Ранее это работало для меня.Я получаю эту ошибку.У кого-нибудь есть идеи для решения этой проблемы?
Часть моего кода:
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");
}
Я прочитал несколько веток по этой проблеме.Но я не нашел правильного ответа