1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | I have a set of automations that work fantastically in Firefox and Chrome, and I'd like to launch an instance of IEDriver as well. I 've set up IEDriver as per Selenium' s Google Code wiki, with the correct path ( if I change the path I get a different exception, so it 's definitely correct). But for some reason it still can' t launch, and just times out. The code to launch it (the last line throws the exception): File ieDriver = new File( "C:/Users/whatever/path/IEDriverServer.exe" ); System.setProperty( "webdriver.ie.driver" , ieDriver.getAbsolutePath()); WebDriver ie = new InternetExplorerDriver(); And the exception is: Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Build info: version: '2.33.0' , revision: '4ecaf82108b2a6cc6f006aae81961236eba93358' , time: '2013-05-22 12:00:17' System info: os.name: 'Windows 7' , os.arch: 'x86' , os.version: '6.1' , java.version: '1.7.0_21' Driver info: driver.version: InternetExplorerDriver at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java: 548 ) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java: 216 ) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java: 201 ) at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java: 184 ) at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java: 174 ) at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java: 143 ) at uk.co.know.kiteTest.WebDriverManager.<init>(WebDriverManager.java: 52 ) at uk.co.know.kiteTest.RunAutomations.main(RunAutomations.java: 13 ) Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start. Build info: version: '2.33.0' , revision: '4ecaf82108b2a6cc6f006aae81961236eba93358' , time: '2013-05-22 12:00:17' System info: os.name: 'Windows 7' , os.arch: 'x86' , os.version: '6.1' , java.version: '1.7.0_21' Driver info: driver.version: InternetExplorerDriver at org.openqa.selenium.remote.service.DriverService.start(DriverService.java: 165 ) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java: 62 ) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java: 527 ) ... 7 more Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http: //localhost:38622/status] to be available after 20014 ms at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java: 104 ) at org.openqa.selenium.remote.service.DriverService.start(DriverService.java: 163 ) ... 9 more Caused by: com.google.common.util.concurrent.UncheckedTimeoutException: java.util.concurrent.TimeoutException at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java: 143 ) at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java: 79 ) ... 10 more |
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser
出现这种异常的问题官方给了两种可能的原因:( 官方链接:http://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/remote/UnreachableBrowserException.html)
Indicates there was a problem communicating with the browser being controlled or the Selenium server. The most common causes for this exception are: 1 .The provided server address to RemoteWebDriver is invalid, so the connection could not be established. 2 .The browser has died mid-test. |
第一种,是说远程ip可能有问题,所有连接不上,这个应该归为一大类,凡是连接其他PC都没有问题,唯独这台电脑有问题,那么毫无疑问,就是ip连接方面的问题。
第二种,浏览器的问题。
我的电脑是ping 都ping 不通,然后关闭掉远程连接的机器的防火墙,ping 的通之后,再连接一下就成功了。
当然也有可能是程序有问题,可参见http://www.cnblogs.com/amosli/p/3409024.html这篇文章。
分类:
自动化测试
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架