selenium 远程连接超时

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '2.42.2', revision: '6a6995d31c7c56c340d6f45a76976d43506cd6cc', time: '2014-06-03 10:52:47'
System info: host: 'Lenovo-PC', ip: '192.168.200.1', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.7.0_07'
Driver info: driver.version: RemoteWebDriver
 at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:593)
 at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:352)
 at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:449)
 at org.openqa.selenium.By$ByXPath.findElement(By.java:357)
 at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:344)
 at org.apache.commons.selenium.SeleniumUtil$1.apply(SeleniumUtil.java:71)
 at org.apache.commons.selenium.SeleniumUtil$1.apply(SeleniumUtil.java:1)
 at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:208)
 at org.apache.commons.selenium.SeleniumUtil.getWebElement(SeleniumUtil.java:68)
 at org.apache.commons.selenium.SeleniumMailProxyHtmlunitSina.execute(SeleniumMailProxyHtmlunitSina.java:215)
 at org.apache.commons.selenium.SeleniumMailProxyHtmlunitSina.testprxy(SeleniumMailProxyHtmlunitSina.java:377)
 at org.apache.commons.selenium.SeleniumMailProxyHtmlunitSina.execte(SeleniumMailProxyHtmlunitSina.java:323)
 at org.apache.commons.selenium.SeleniumMailProxyHtmlunitSina.execteAll(SeleniumMailProxyHtmlunitSina.java:296)
 at org.apache.commons.selenium.ExecuteSina.main(ExecuteSina.java:10)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to 127.0.0.1:7056 [/127.0.0.1] failed: Connection refused: connect
 at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:138)
 at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:314)
 at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:357)
 at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:218)
 at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:194)
 at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:85)
 at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
 at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)
 at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
 at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
 at org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:222)
 at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:173)
 at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.execute(NewProfileExtensionConnection.java:165)
 at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:362)
 at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:572)
 ... 13 more
Caused by: java.net.ConnectException: Connection refused: connect
 at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
 at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:75)
 at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
 at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
 at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
 at java.net.Socket.connect(Socket.java:579)
 at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:72)
 at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:118)
 ... 27 more

 

用了代理,连接远程。其过程中可能代理失效,连接失败。导致系统卡死

设置连接超时

读取数据超时

System.setProperty("sun.net.client.defaultConnectTimeout", "95000");
          System.setProperty("sun.net.client.defaultReadTimeout", "95000");

你可能感兴趣的:(selenium 远程连接超时)