简体   繁体   English

org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost error with IEDriverServer

[英]org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost error with IEDriverServer

I have tried IE launch in webdriver as below, I have checked all protected mode settings in security tab of Internet Options, zoom level is 100%, environment variable even set, But not able to launch IE browser in the simple selenium code;我试过如下在 webdriver 中启动 IE,我检查了 Internet 选项的安全选项卡中的所有保护模式设置,缩放级别为 100%,甚至设置了环境变量,但无法在简单的 selenium 代码中启动 IE 浏览器; Errors seen as Failed to connect to local host though gave url http://google.co.in and Caused by: java.net.ConnectException: Connection refused: Can someone please help me out with this issue.被视为无法连接到本地主机的错误虽然给出了 url http://google.co.in并由以下原因引起:java.net.ConnectException:连接被拒绝:有人可以帮我解决这个问题。 Thank you in advance提前谢谢你

package eHMS_package;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;

public class EHMS_Login {

    public WebDriver driver;

    public static void main(String[] args)
    {
        System.setProperty("webdriver.ie.driver", "E:/SRIKANTH/IEDriver/IEDriverServer.exe");
        WebDriver driver = new InternetExplorerDriver();
        driver.navigate().to("http://google.co.in");
    }
}

Error Details :错误详情:

Started InternetExplorerDriver server (64-bit)
3.9.0.0 Listening on port 48107 Only local connections are allowed Exception in thread "main" org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:48107 Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:33:15.31Z' System info: host: 'UMANATH-PC', ip: '10.1.0.25', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_161' Driver info: driver.version: InternetExplorerDriver    at 

org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:92)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
        at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:209)
        at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:223)
        at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:215)
        at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:152)
        at eHMS_package.EHMS_Login.main(EHMS_Login.java:15)
    Caused by: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:48107
        at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:240)
        at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:158)
        at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:256)
        at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:134)
        at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:113)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
        at okhttp3.RealCall.execute(RealCall.java:77)
        at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:101)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:101)
        at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
        at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
        at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
        ... 6 more
    Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
        at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
        at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
        at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at okhttp3.internal.platform.Platform.connectSocket(Platform.java:125)
        at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:238)
        ... 28 more

The error says it all :错误说明了一切:

Started InternetExplorerDriver server (64-bit)3.9.0.0 
Exception in thread "main" org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:48107 
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:33:15.31Z' 
System info: host: 'UMANATH-PC', ip: '10.1.0.25', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_161' 
Driver info: driver.version: InternetExplorerDriver

It is clear from the error stack trace that InternetExplorerDriver server is not getting detected back as in :从错误堆栈跟踪中可以清楚地看出InternetExplorerDriver 服务器没有被检测到:

Driver info: driver.version: InternetExplorerDriver

Your main issue is the version compatibility between the binaries you are using as follows :您的主要问题是您使用的二进制文件之间的版本兼容性如下:

  • You are using Selenium Client v3.11.0您正在使用Selenium Client v3.11.0
  • But you are using InternetExplorerDriverServer v3.9.0.0但是你使用的是InternetExplorerDriverServer v3.9.0.0

So there is a clear mismatch between the Selenium Client v 3.11.0 and InternetExplorerDriverServer v 3.9.0.0 .因此, Selenium Client v 3.11.0InternetExplorerDriverServer v 3.9.0.0之间存在明显的不匹配。

Solution解决方案

  • Upgrade to InternetExplorerDriverServer v 3.11.1.0升级到InternetExplorerDriverServer v 3.11.1.0

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误“org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/” with GeckoDriver 和 Firefox - error“ org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/” with GeckoDriver and Firefox org.openqa.selenium.WebDriverException: java.net.ConnectException: 无法使用 GeckoDriver 和 Selenium 连接到 localhost/0:0:0:0:0:0:0:1:1941 - org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:1941 with GeckoDriver and Selenium org.openqa.selenium.WebDriverException: java.net.ConnectException: 无法使用 GeckoDriver Firefox 和 Selenium 连接到 localhost/0:0:0:0:0:0:0 - org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0 using GeckoDriver Firefox and Selenium org.openqa.selenium.WebDriverException:java.net.ConnectException:使用Gecko驱动程序无法连接到本地主机 - org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost with Gecko driver org.openqa.selenium.WebDriverException:java.net.ConnectException,我该如何解决 - org.openqa.selenium.WebDriverException: java.net.ConnectException , HOW CAN i RESOLVE WebDriverException:java.net.ConnectException:无法在MacOS上使用Selenium 3和chromedriver连接到localhost错误 - WebDriverException: java.net.ConnectException: Failed to connect to localhost error with Selenium 3 and chromedriver on MacOS org.openqa.selenium.WebDriverException:未知错误:chrome 无法通过 Java 开始使用 Selenium ChromeDriver 和 Chrome - org.openqa.selenium.WebDriverException: unknown error: chrome failed to start using Selenium ChromeDriver and Chrome through Java 树莓派 2 B + Selenium Java = WebDriverException: java.net.ConnectException: 连接失败 - Raspberry pi 2 B + Selenium Java = WebDriverException: java.net.ConnectException: Failed to connect org.openqa.selenium.WebDriverException:浏览器无法启动,在fluentlium中测试 - org.openqa.selenium.WebDriverException: Browser failed to start, test in fluentlium java.net.ConnectException:无法使用 ChromeDriver Chrome 通过 Spring Bot 中的 Selenium Java 连接到 localhost/0:0:0:0:0:0:0:1:1731 - java.net.ConnectException : Failed to connect to localhost/0:0:0:0:0:0:0:1:1731 using ChromeDriver Chrome through Selenium Java in Spring Bot
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM