firefox

时间:2017-04-05 04:41:19

标签: selenium-webdriver

While launching firefox browserin eclipse i am getting an error as mentioned below Usage:

E:\ new gecko \ geckodriver.exe [OPTIONS]     E:\ new gecko \ geckodriver.exe:未知选项--port = 30415     线程“main”中的异常org.openqa.selenium.WebDriverException:org.apache.http.conn.HttpHostConnectException:连接到localhost:30415 [localhost / 127.0.0.1,localhost / 0:0:0:0:0:0: 0:1]失败:连接被拒绝:连接     构建信息:版本:'未知',修订版:'5234b32',时间:'2017-03-10 09:00:17 -0800'     系统信息:主机:'KIREETI-PC',ip:'192.168.43.138',os.name:'Windows 7',os.arch:'amd64',os.version:'6.1',java.version:'1.8 .0_111'     驱动程序信息:driver.version:FirefoxDriver         在org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:91)         在org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)         在org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:244)         在org.openqa.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:131)         在org.openqa.selenium.firefox.FirefoxDriver。(FirefoxDriver.java:218)         在org.openqa.selenium.firefox.FirefoxDriver。(FirefoxDriver.java:125)         在org.openqa.selenium.firefox.FirefoxDriver。(FirefoxDriver.java:121)         在sriram.main(sriram.java:17)     引起:org.apache.http.conn.HttpHostConnectException:连接到localhost:30415 [localhost / 127.0.0.1,localhost / 0:0:0:0:0:0:0:1]失败:连接被拒绝:连接         at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:158)         at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)         at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)         在org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)         在org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)         在org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)         在org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)         在org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)         在org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)         在org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)         在org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:142)         在org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:88)         在org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:296)         在org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:113)         在org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)         在org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)         ......还有7个     引起:java.net.ConnectException:连接被拒绝:连接         at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)         在java.net.DualStackPlainSocketImpl.socketConnect(未知来源)         at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)         at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)         在java.net.AbstractPlainSocketImpl.connect(未知来源)         在java.net.PlainSocketImpl.connect(未知来源)         在java.net.SocksSocketImpl.connect(未知来源)         在java.net.Socket.connect(未知来源)         at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)         at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)         ......还有22个

2 个答案:

答案 0 :(得分:0)

您可以在maven中使用“ Webdrivermanager”插件来代替特定浏览器的驱动程序,因此它将解决大多数与浏览器及其实例有关的问题。 甚至这对我克服浏览器相关问题也很有帮助。

答案 1 :(得分:0)

我尝试使用所有最新版本的驱动程序可执行文件(geckodriver.exe),Selenium服务器独立jar(3.14.0)和Firefox浏览器。我没有遇到任何问题。