Selenium WebDriver在RemoteWebElement.Click()上抛出WebDriverTimeoutException

Kov*_*xey 8 .net c# selenium selenium-webdriver

点击很难重现我有一个错误.1-2/10000次点击结束OpenQA.Selenium.WebDriverTimeoutException.看起来元素没有被点击,驱动程序等待一些反应.

Message: timeout: cannot determine loading status
from timeout: Timed out receiving message from renderer: -0.028
  (Session info: chrome=52.0.2743.116)
  (Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 6.3.9600 x86_64)
Stack trace:
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.InternalExecute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebElement.Execute(String commandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebElement.Click()
Run Code Online (Sandbox Code Playgroud)

有时异常消息中的超时看起来是合法的(300秒),但在大多数情况下它具有负值,如-0.028.

我用:

Chrome 52.0.2743.116
Selenium 2.53.1
ChromeDriver 2.23 (also produces with 2.22)
Run Code Online (Sandbox Code Playgroud)

更新:

我也开始得到这个错误 RemoteNavigator.GoToUrl

Type: OpenQA.Selenium.WebDriverTimeoutException
Message: timeout: cannot determine loading status
from timeout: Timed out receiving message from renderer: -0.032
  (Session info: chrome=52.0.2743.116)
  (Driver info: chromedriver=2.23.409699 (49b0fa931cda1caad0ae15b7d1b68004acd05129),platform=Windows NT 6.3.9600 x86_64)
Stack trace:
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.set_Url(String value)
   at OpenQA.Selenium.Remote.RemoteNavigator.GoToUrl(String url)
Run Code Online (Sandbox Code Playgroud)

Kov*_*xey 0

通过将测试运行程序的并行度从 30 降低到 10 解决了这个问题。看起来过度使用 CPU 导致请求由于某种原因无法到达 Web 驱动程序。