硒中的错误
OpenQA.SELENIUM.WEBDRIVEREXCEPTION:“ http请求http请求http http:// localhost:61601/session/session/bf47076dd5340edf30b904f30b904f946dae6dae6f2/url 60秒后。”
ChromeOptions options = new ChromeOptions();
options.AddArgument("no-sandbox");
options.AddArgument("--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0");
// options.AddArgument("ignore-certificate-errors");
options.AddArguments("--disable-blink-features");
options.AddArgument("--disable-blink-features=AutomationControlled");
options.AddExcludedArgument("enable-automation");
options.AddArguments("--disable-infobars");
options.AddHttpProxy(ProxyIp[i], ProxyPort[i], ProxyPassword[i], ProxyLogin[i]);
// options.AddArguments("headless"); //
Console.Write(i.ToString());
Browser = new OpenQA.Selenium.Chrome.ChromeDriver(options);
Browser.Manage().Window.Maximize();
Browser.Navigate().GoToUrl("https://rutube.ru");
Browser.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
// CheckAcceptOption( Browser);
Actions actionProvider = new Actions(Browser);
IWebElement FindOption = Browser.FindElement(By.CssSelector(".char-base-button-module__button.char-base-button-module__contained-accent.char-base-button-module__pointerCursor.char-base-button-module__regular"));
if (FindOption != null)
{
actionProvider.Click(FindOption).Perform();
}
else return;
OpenQA.Selenium.WebDriverException: "The HTTP request to the remote WebDriver server for URL http://localhost:61601/session/bf47076dd5340edf30b904f946dae6f2/url timed out after 60 seconds."
ChromeOptions options = new ChromeOptions();
options.AddArgument("no-sandbox");
options.AddArgument("--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0");
// options.AddArgument("ignore-certificate-errors");
options.AddArguments("--disable-blink-features");
options.AddArgument("--disable-blink-features=AutomationControlled");
options.AddExcludedArgument("enable-automation");
options.AddArguments("--disable-infobars");
options.AddHttpProxy(ProxyIp[i], ProxyPort[i], ProxyPassword[i], ProxyLogin[i]);
// options.AddArguments("headless"); //
Console.Write(i.ToString());
Browser = new OpenQA.Selenium.Chrome.ChromeDriver(options);
Browser.Manage().Window.Maximize();
Browser.Navigate().GoToUrl("https://rutube.ru");
Browser.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
// CheckAcceptOption( Browser);
Actions actionProvider = new Actions(Browser);
IWebElement FindOption = Browser.FindElement(By.CssSelector(".char-base-button-module__button.char-base-button-module__contained-accent.char-base-button-module__pointerCursor.char-base-button-module__regular"));
if (FindOption != null)
{
actionProvider.Click(FindOption).Perform();
}
else return;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在运行硒测试用例时遇到了很多次这个问题。这就是我解决这个问题的方式。
temp
文件夹并将其清空。然后再次进行测试。要转到temp文件夹 - 按
win + r
,键入%temp%
&点击输入。或
I have encountered that issue many times while running selenium test cases. This is how i solve this problem.
temp
folder and empty it. Then run your test again.To go to temp folder - press
Win + R
, type%temp%
& hit enter.OR