首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >45000毫秒后,无法连接到端口7055上的主机127.0.0.1。使用Selenium3

45000毫秒后,无法连接到端口7055上的主机127.0.0.1。使用Selenium3
EN

Stack Overflow用户
提问于 2017-01-23 14:43:53
回答 2查看 2.6K关注 0票数 2
代码语言:javascript
复制
Browser: Firefox 50 version
Selenium Jar files : 3.0.1 jar
OS: Windows 7 enterprise 64 bit 

当通过右键单击xml文件"Run as testNG suite“执行脚本时,浏览器打开,但立即在控制台中显示错误。

谁能指导我做我需要降级的浏览器,如果是这样的话,什么是selenium 3版本的支持版本。

错误日志:

代码语言:javascript
复制
[TestNG] Running:
  C:\Users\raghuveer.amajala\AppData\Local\Temp\testng-eclipse-1646049448\testng-customsuite.xml

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
true,"v":"1.0","st":1478328645000}},"winreg-app-user":{"ocplugin@webex.com":{"d":"C:\\Program Files (x86)\\WebEx\\Productivity Tools","e":false,"v":"2.0","st":1485264359732,"mt":1463471846535}},"app-global":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","e":true,"v":"50.0","st":1478328645000}},"winreg-app-global":{"{D19CA586-DD6C-4a0a-96F8-14644F340D60}":{"d":"C:\\Program Files (x86)\\Common Files\\McAfee\\SystemCore","e":false,"v":"15.4.0","st":1477288713580,"mt":1476678768866}}}
1485322859314   addons.xpi  DEBUG   No changes found
1485322859325   addons.xpi  DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\aushelper@mozilla.org.xpi
1485322859326   addons.xpi  DEBUG   Loading bootstrap scope from C:\Program Files (x86)\Mozilla Firefox\browser\features\aushelper@mozilla.org.xpi
1485322859331   addons.xpi  DEBUG   Calling bootstrap method startup on aushelper@mozilla.org version 1.0
1485322859333   addons.xpi  DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi
1485322859334   addons.xpi  DEBUG   Loading bootstrap scope from C:\Program Files (x86)\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi
1485322859343   addons.xpi  DEBUG   Calling bootstrap method startup on e10srollout@mozilla.org version 1.5
1485322859344   addons.xpi  DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1485322859345   addons.xpi  DEBUG   Loading bootstrap scope from C:\Program Files (x86)\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1485322859349   addons.xpi  DEBUG   Calling bootstrap method startup on firefox@getpocket.com version 1.0.5
1485322859360   addons.xpi-utils    DEBUG   Starting async load of XPI database C:\Users\RAGHUV~1.AMA\AppData\Local\Temp\anonymous8881786919455687854webdriver-profile\extensions.json
1485322859362   addons.xpi  DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi
1485322859362   addons.xpi  DEBUG   Loading bootstrap scope from C:\Program Files (x86)\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi
1485322859365   addons.xpi  DEBUG   Calling bootstrap method startup on webcompat@mozilla.org version 1.0
1485322859367   addons.manager  DEBUG   Registering shutdown blocker for XPIProvider
1485322859367   addons.manager  DEBUG   Provider finished startup: XPIProvider
1485322859367   addons.manager  DEBUG   Starting provider: LightweightThemeManager
1485322859367   addons.manager  DEBUG   Registering shutdown blocker for LightweightThemeManager
1485322859368   addons.manager  DEBUG   Provider finished startup: LightweightThemeManager
1485322859368   addons.manager  DEBUG   Starting provider: GMPProvider
1485322859386   addons.manager  DEBUG   Registering shutdown blocker for GMPProvider
1485322859386   addons.manager  DEBUG   Provider finished startup: GMPProvider
1485322859386   addons.manager  DEBUG   Starting provider: PluginProvider
1485322859387   addons.manager  DEBUG   Registering shutdown blocker for PluginProvider
1485322859387   addons.manager  DEBUG   Provider finished startup: PluginProvider
1485322859387   addons.manager  DEBUG   Completed startup sequence
1485322859726   addons.xpi-utils    DEBUG   Async JSON file read took 0 MS
1485322859726   addons.xpi-utils    DEBUG   Finished async read of XPI database, parsing...
1485322859728   addons.xpi-utils    DEBUG   Successfully read XPI database
1485322859739   addons.manager  DEBUG   Starting provider: <unnamed-provider>
1485322859739   addons.manager  DEBUG   Registering shutdown blocker for <unnamed-provider>
1485322859740   addons.manager  DEBUG   Provider finished startup: <unnamed-provider>
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
1485322859848   addons.manager  DEBUG   Starting provider: PreviousExperimentProvider
1485322859849   addons.manager  DEBUG   Registering shutdown blocker for PreviousExperimentProvider
1485322859849   addons.manager  DEBUG   Provider finished startup: PreviousExperimentProvider

    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:182)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:95)
    at Registration.Registration_webdriver.SetUp(Registration_webdriver.java:88)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
    at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107)
    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    at org.testng.TestRunner.run(TestRunner.java:617)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
    at org.testng.TestNG.run(TestNG.java:1057)
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)`

下面是setup()方法,这是我之前的类。

代码语言:javascript
复制
@BeforeClass
public void SetUp()throws Exception
{ 
 //System.setProperty("webdriver.ie.driver","D:\\jar-files\\IEDriverServer_Win32_2.39.0\\IEDriverServer.exe");
 //driver = new InternetExplorerDriver();
    //String firefoxlocation=System.getenv("ProgramFiles(X86)")+"\\Mozilla Firefox\\firefox.exe";
    //System.setProperty("webdriver.firefox.bin", firefoxlocation);
    System.setProperty("webdriver.gecko.driver", driverPath+"geckodriver.exe");
    driver = new FirefoxDriver();
    driver.get(partnerportalurl);
    driver.manage().window().maximize();
    String title=driver.getTitle();
    System.out.println(title);

}
EN

回答 2

Stack Overflow用户

发布于 2017-01-23 17:11:58

selenium尝试使用当前安装在您的机器上的firefox。此版本可能比您的selenium版本中支持的版本更新。要解决这个问题,你可以下载一个兼容的火狐版本,并在DesiredCapabilities中传递它。阅读支持的火狐版本的selenium changelog总是很有帮助的。

代码语言:javascript
复制
DesiredCapabilities capabilities = new DesiredCapabilities();

// linux
capabilities.setCapability(FirefoxDriver.BINARY, "/path/to/your_firefox/firefox-bin");
// win
capabilities.setCapability(FirefoxDriver.BINARY, "C:\\path\\to\\your_firefox\\firefox.exe");

WebDriver webdriver = new FirefoxDriver(capabilities);
票数 0
EN

Stack Overflow用户

发布于 2017-02-07 20:04:15

只需降级到firefox 47.0.1并禁用更新即可。每当firefox更新到版本50时,我都会遇到这个问题。(在selenium 2.x和3.x上测试的问题)。

请看一下here

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41800597

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档