c# - OpenQA.Selenium.WebDriverException :对远程 WebDriver 服务器的 HTTP 请求 URL http://localhost :点击 90 秒后超时
问题描述
在 TFS 错误上执行自动化脚本时出现以下错误,
错误信息:
OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:59508/session/b655773d161676bad7ab56591cce3cf2/element/1560281f-e8b2-4bd7-a6c7-7eba3a94adc9/click timed out after 90 seconds.
----> System.Net.WebException : The operation has timed out
堆栈跟踪:
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.RemoteWebElement.Execute(String commandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebElement.Click()
at QuotOMatic.Test.UI.Pages.Login.LogIn() in D:\B\2\2\s\QuotOMatic.Test.UI\Pages\Login.cs:line 117
at QuotOMatic.Test.UI.Tests.TC418369_Broker_Authentication_SmokeTest._Login() in D:\B\2\2\s\QuotOMatic.Test.UI\Tests\TC418369_Broker_Authentication_SmokeTest.cs:line 29
--WebException
at System.Net.HttpWebRequest.GetResponse()
at OpenQA.Selenium.Remote.HttpCommandExecutor.MakeHttpRequest(HttpRequestInfo requestInfo)
我做了以下工作来解决这个问题:
- 使用“提交”而不是“点击”
- 创建进程以识别服务器上打开的 chrome 实例并关闭(杀死 PID)它们
代码试验:
ChromeOptions options = new ChromeOptions(); options.AddArgument("no-sandbox"); _driver = new ChromeDriver(chromeService, options, TimeSpan.FromSeconds(120));
你能指导我解决这个问题吗???
解决方案
推荐阅读
- r - 调整 ggpubr 中统计信息的位置
- django - Django Form 忽略翻译并回退到默认值
- tensorflow - Keras 中(有些)重叠子模型的多个损失函数
- python - 创建交互式 Twitter 网络图,当鼠标悬停在边缘时显示推文
- c# - 如何在 ASP.NET Core MVC“待办事项”应用程序中提取 URL 的文件名并在视图中将其显示给用户?
- java - Elasticsearch 按搜索条件分组/聚合响应
- json - 以 JSON 格式转义双引号 - powershell,azure cli
- python - Python 请求获取 Json 响应,其中某些字段编码不正确
- python - 将 tkinter 条目保存到文本文件
- python - Ray 没有公平分配任务的问题。严重偏向主节点