Random NoHttpResponseException with ChromeDriver in Selenium
Google made an update to Chrome over the weekend and I am trying to run some automated tests using Selenium. Ever since the update, every few 5 or 6 runs results in the following error. I run the test immediately again and it works fine. It's just really annoying because it breaks randomly.
org.openqa.selenium.WebDriverException: org.apache.http.NoHttpResponseException: The target server failed to respond
Build info: version: '2.6.0', revision: '13840', time: '2011-09-13 16:51:41'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_26'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.chrome.ChromeComma开发者_开发技巧ndExecutor.execute(ChromeCommandExecutor.java:59)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:377)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:182)
at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:199)
at org.openqa.selenium.By$ById.findElement(By.java:210)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:174)
at com.core.FindElementAndWait.apply(FindElementAndWait.java:28)
at com.core.FindElementAndWait.apply(FindElementAndWait.java:1)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:173)
... 68 more
I've got a fix for this bug, but it's not been released yet. There's a workaround at https://code.google.com/p/selenium/issues/detail?id=2513 and if you track that issue, you will be notified of the fix's progress.
We have seen the same problem with ChromeDriver. The solution in our case was to add a Thread.sleep(1)
between each and every call to the selenium RC API.
For some reason, it solved the issue.
精彩评论