我目前正在关注Selenium Waits上的这个教程:click me
我无论如何也搞不懂为什么我的ImplicitWait被忽略了。
private void TryFind()
{
_driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
//go to a url that contains a dynamically loading page element
_driver.Navigate().GoToUrl(URI);
//click the start button
_driver.FindElement(By.TagName("button")).Click();
//find the element that has the text Hello World
var text = _driver.FindElement(By.XPath(".//*[contains(text(),'Hello World!')]"));
//click on the text
text.Click();
}我希望它在单击元素之前等待5秒钟,但它只是匆忙地抛出了一个异常。
有什么想法吗?
谢谢
发布于 2017-11-12 08:55:37
事实证明,这是一个Selenium错误--我向教程作者提出了这个问题,他提出了一个错误:https://github.com/SeleniumHQ/selenium/issues/5044
JeffC,我记下了--谢谢。调试它是我还在习惯的东西,但我会在下次尝试给出更多的信息。
https://stackoverflow.com/questions/47225497
复制相似问题