【问题标题】:Selenium webdriver doesn't open application urlSelenium webdriver 不打开应用程序 url
【发布时间】:2016-09-21 21:05:32
【问题描述】:

我使用 selenium webdriver 创建了一个测试框架,并且我在 Firefox 44.0.2 中运行了相同的框架,两天前它运行良好。 但是现在它打开了Firefox浏览器,但没有导航到.get方法中提到的url,下面是我的url导航代码和我得到的异常:-

WebDriver driver=new FirefoxDriver();
        driver.get("http://seleniumpractise.blogspot.in/2016/08/how-to-use-explicit-wait-in-selenium.html");

例外:-

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7056 after 45000 ms. Firefox console output:
sions\\fxdriver@googlecode.com","installDate":1474450844360,"updateDate":1474450844360,"applyBackgroundUpdates":1,"bootstrap":false,"size":3213569,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":true,"hasBinaryComponents":true,"strictCompatibility":false,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"3.0","maxVersion":"45.0"}],"targetPlatforms":[{"os":"Darwin","abi":null},{"os":"SunOS","abi":null},{"os":"FreeBSD","abi":null},{"os":"OpenBSD","abi":null},{"os":"WINNT","abi":"x86-msvc"},{"os":"Linux","abi":null}],"multiprocessCompatible":false,"signedState":0}
1474450846803   addons.xpi  DEBUG   Updating XPIState for {"id":"{972ce4c6-7e08-4474-a285-3208198ce6fd}","syncGUID":"4YrFqCoch9_A","location":"app-global","version":"44.0.2","type":"theme","internalName":"classic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\\Program Files\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","installDate":1473742108164,"updateDate":1473742108164,"applyBackgroundUpdates":1,"skinnable":true,"size":24172,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"44.0.2","maxVersion":"44.0.2"}],"targetPlatforms":[]}
1474450846803   addons.xpi  DEBUG   getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1474450846804   DeferredSave.extensions.json    DEBUG   Save changes
1474450846805   addons.xpi  DEBUG   Updating database with changes to installed add-ons
1474450846805   addons.xpi-utils    DEBUG   Updating add-on states
1474450846806   addons.xpi-utils    DEBUG   Writing add-ons list
1474450846819   addons.manager  DEBUG   Registering shutdown blocker for XPIProvider
1474450846820   addons.manager  DEBUG   Provider finished startup: XPIProvider
1474450846820   addons.manager  DEBUG   Starting provider: LightweightThemeManager
1474450846820   addons.manager  DEBUG   Registering shutdown blocker for LightweightThemeManager
1474450846820   addons.manager  DEBUG   Provider finished startup: LightweightThemeManager
1474450846820   addons.manager  DEBUG   Starting provider: GMPProvider
1474450846832   addons.manager  DEBUG   Registering shutdown blocker for GMPProvider
1474450846833   addons.manager  DEBUG   Provider finished startup: GMPProvider
1474450846833   addons.manager  DEBUG   Starting provider: PluginProvider
1474450846833   addons.manager  DEBUG   Registering shutdown blocker for PluginProvider
1474450846833   addons.manager  DEBUG   Provider finished startup: PluginProvider
1474450846833   addons.manager  DEBUG   Completed startup sequence
1474450847985   addons.manager  DEBUG   Starting provider: <unnamed-provider>
1474450847985   addons.manager  DEBUG   Registering shutdown blocker for <unnamed-provider>
1474450847986   addons.manager  DEBUG   Provider finished startup: <unnamed-provider>
1474450848873   DeferredSave.extensions.json    DEBUG   Starting write
1474450849387   addons.repository   DEBUG   No addons.json found.
1474450849387   DeferredSave.addons.json    DEBUG   Save changes
1474450849393   DeferredSave.addons.json    DEBUG   Starting timer
1474450849415   addons.manager  DEBUG   Starting provider: PreviousExperimentProvider
1474450849415   addons.manager  DEBUG   Registering shutdown blocker for PreviousExperimentProvider
1474450849416   addons.manager  DEBUG   Provider finished startup: PreviousExperimentProvider
1474450849420   DeferredSave.extensions.json    DEBUG   Write succeeded
1474450849420   addons.xpi-utils    DEBUG   XPI Database saved, setting schema version preference to 17
1474450849457   DeferredSave.addons.json    DEBUG   Starting write
1474450849470   DeferredSave.addons.json    DEBUG   Write succeeded

    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:122)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:117)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:218)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:207)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
    at dd_core.page.init(page.java:68)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:296)
    at org.testng.SuiteRunner.run(SuiteRunner.java:259)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
    at org.testng.TestNG.run(TestNG.java:1018)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

我添加了selenium-java-2.48.2.jar。请建议!

【问题讨论】:

  • 你能不能尝试将 Firefox 版本更新到 46

标签: selenium selenium-webdriver


【解决方案1】:

FF 46.0 可以正常工作,尝试更新 ff 版本。

【讨论】:

  • @All:- 刚刚将我的 FF 版本更新到 46.0.1 但它抛出了同样的异常。
  • 你能分享一下你用过的.jar文件列表吗?
  • @all:- 谢谢:- 通过将我的 selenium jars 文件更新到 2.53.1 版本问题得到解决。补充:- selenium-server-standalone-2.53.1.jar 和 selenium-java-2.53.1.jar 问题得到解决!!
【解决方案2】:

大多数时候因为浏览器版本而发生,只需升级您的版本并再次运行您的代码

【讨论】:

    猜你喜欢
    • 2018-02-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-03
    • 2011-11-12
    • 1970-01-01
    相关资源
    最近更新 更多