gpt4 book ai didi

c# - 仅在远程运行时通过 Selenium 测试中途抛出 WebDriverException

转载 作者:太空狗 更新时间:2023-10-29 19:46:30 28 4
gpt4 key购买 nike

我的一组测试似乎只有在远程运行时和尝试与特定元素交互时才会出现问题。我正在通过 VSTS 构建和运行它。

错误:

OpenQA.Selenium.WebDriverException: A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL (URL redacted, is a localhost URL). The status of the exception was ReceiveFailure, and the message was: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

我试图在其中输入数字的元素的 HTML(我们正在使用敲除):

<input type="number" min="0" max="999" data-bind="value: redacted).extend({ min: 0, required: { message: 'redacted' } }), disable: redacted" name="redacted" id="redacted" title="redacted" required="required" class="">

不要介意 redacted。我想将所有属性保留在那里以显示为元素设置了哪些属性,但实际值已被编辑。

这是我用来在元素中输入值的代码:

IWebElement element = driver.FindElement(By.Id(elementID));
element.Clear();
element.SendKeys(value);

这与 ChromeDriver 一起运行。我可以成功地将数据填充到其他几个数字字段中而不会出现问题。

您知道这里可能出了什么问题以及如何解决吗?

最佳答案

这看起来像是 VSTS 构建服务器上的某种 SSL 或内部网络问题,可能很难获得更多信息,因为您不应该拥有对该机器的完全访问权限。

我们也对我们的持续集成进行了 Selenium 测试,但我们使用绑定(bind)到 VSTS 的本地构建服务器,对构建和流程有更多控制。

关于c# - 仅在远程运行时通过 Selenium 测试中途抛出 WebDriverException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42378287/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com