【发布时间】:2016-02-23 05:34:12
【问题描述】:
我在 specflow 中有一个测试,在“运行测试”模式下运行时有效,但在“调试”模式下运行时失败。
给出的问题是一个 selenium webdriver 问题:
OpenQA.Selenium.WebDriverTimeoutException: 60 秒后超时 ---> OpenQA.Selenium.NoSuchElementException: 没有这样的元素 (会话信息:chrome=48.0.2564.97) (驱动信息:chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf),platform=Windows NT 6.1 SP1 x86_64)
请告知可能是什么问题。
非常感谢, 拉胡尔·迪克西特
【问题讨论】:
-
能否提供代码?
-
public static bool WaitForDisplayed(this IWebDriver driver, By selector) { WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));返回 wait.Until((d) => d.FindElement(selector).Displayed);等待失败
-
您是否使用 NUnit 测试适配器在 Visual Studio 中运行测试?如果是这样,您是否在工具栏的列表框中选择“调试”?