我收到带有以下消息的OpenQA.Selenium.WebDriverException: “对URL http://localhost:29500/session/027d8dd508fe0f2e9efa3af18751cb24/element的远程WebDriver服务器的HTTP请求在60秒后超时。”
当我更改代码中的某些内容时,这个问题开始发生,我看不到它们如何可能导致该问题。我还尝试过将参数“ no-sandbox”添加到ChromeDriver的选项中,但是很遗憾,它没有帮助。
this.driver.SetElementValue(By.Name("Donations(-1).username"),
this.nameTxt.Text);
/* here is the relevant code in the class I've made which inherits from
OpenQA.Selenium.Chrome.ChromeDriver */
public class ChromiumDriver : ChromeDriver
{
public void SetElementValue(By by, string value)
{
/* The following FindElement method causes the exception */
/* NOTE that this exception was also thrown on various different
lines of code, and not only when trying to find an element */
this.SetElementValue(this.FindElement(by), value);
}
public void SetElementValue(IWebElement elem, string value)
{
this.ExecuteScript("arguments[0].value = '" + value + "';", elem);
}
}
在其他情况下,我希望找到该元素并更改其值-我希望单击一个元素。相反,我遇到了上面的异常。
非常感谢任何可以尝试帮助我的人!