我无法使用我在下面的代码中使用的URL获取页面

时间:2015-02-27 11:38:17

标签: firefox selenium-webdriver

package erewards;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class erewards_admin {

    public static void main(String args[]){

        FirefoxDriver d1 = new FirefoxDriver();


         d1.get("http://www.google.com");  
        // d1.close();
        // System.exit(0);


 } } 

以下是我在运行时获得的错误。

    error:
    org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
    DAD38A}":{"d":"C:\\Program Files\\Mozilla Firefox\\browser\\extensions\\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi","e":true,"v":"7.3.16540.9015","st":1405342340000},"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"C:\\Program Files\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","e":true,"v":"36.0","st":1424934772238,"mt":1424934771658}},"winreg-app-global":{"fiddlerhook@fiddler2.com":{"d":"C:\\Program Files\\Fiddler2\\FiddlerHook","e":false,"v":"2.4.8.3","st":1415012376210,"mt":1406724252000}}}
    1425038534487   addons.xpi  DEBUG   No changes found
    1425038534492   addons.xpi  DEBUG   Registering manifest for C:\Program Files\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
    1425038534493   addons.xpi  DEBUG   Loading bootstrap scope from C:\Program Files\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
    1425038534500   addons.xpi  DEBUG   Calling bootstrap method startup on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} version 7.3.16540.9015
    1425038534563   addons.manager  DEBUG   Registering shutdown blocker for XPIProvider
    1425038534563   addons.manager  DEBUG   Registering shutdown blocker for LightweightThemeManager
    1425038534565   addons.manager  DEBUG   Registering shutdown blocker for OpenH264Provider
    1425038534565   addons.manager  DEBUG   Registering shutdown blocker for PluginProvider
    JavaScript error: file:///C:/Users/pcs/AppData/Local/Temp/anonymous3272192605644315779webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js, line 11487: TypeError: this.server_ is undefined
    JavaScript error: chrome://fxdriver/content/server.js, line 38: NS_ERROR_XPC_CI_RETURNED_FAILURE: Component returned failure code: 0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE) [nsIJSCID.createInstance]
    *** Blocklist::_preloadBlocklistFile: blocklist is disabled
    1425038536584   addons.manager  DEBUG   Registering shutdown blocker for <unnamed-provider>
    console.error: skype_ff_extension: 
      DEPRECATED: The widget module is deprecated.  Please consider using the sdk/ui module instead.
    Traceback (most recent call last):
      File "resource://gre/modules/Promise-backend.js", line 870, in Handler.prototype.process
        nextValue = this.onResolve.call(undefined, nextValue);
      File "resource://gre/modules/commonjs/sdk/addon/runner.js", line 86, in startup/</<
        run(options);
      File "resource://gre/modules/commonjs/sdk/addon/runner.js", line 145, in run
        let program = main(options.loader, options.main);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 684, in main
        return loader.load(loader, module).exports;
      File "resource://gre/modules/commonjs/sdk/loader/cuddlefish.js", line 129, in CuddlefishLoader/options<.load
        result = load(loader, module);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 318, in load
        evaluate(sandbox, module.uri);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 267, in evaluate
        : loadSubScript(uri, sandbox, encoding);
      File "resource://skype_ff_extension-at-jetpack/skype_ff_extension/lib/main.js", line 14, in null
        var widgets = require("sdk/widget");
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 591, in require
        freeze(load(loader, module));
      File "resource://gre/modules/commonjs/sdk/loader/cuddlefish.js", line 129, in CuddlefishLoader/options<.load
        result = load(loader, module);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 318, in load
        evaluate(sandbox, module.uri);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 267, in evaluate
        : loadSubScript(uri, sandbox, encoding);
      File "resource://gre/modules/commonjs/sdk/widget.js", line 59, in null
        require("./util/deprecate").deprecateUsage(
      File "resource://gre/modules/commonjs/sdk/util/deprecate.js", line 18, in deprecateUsage
        let stack = get().slice(2);
    JavaScript error: resource://skype_ff_extension-at-jetpack/skype_ff_extension/data/c2c_options_menu_localization.js, line 189: TypeError: document.getElementById(...) is null

        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 erewards.erewards_admin.main(erewards_admin.java:14)
    Exception in thread "main" org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files\Mozilla Firefox\firefox.exe) on port 7055; process output follows: 
    DAD38A}":{"d":"C:\\Program Files\\Mozilla Firefox\\browser\\extensions\\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi","e":true,"v":"7.3.16540.9015","st":1405342340000},"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"C:\\Program Files\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","e":true,"v":"36.0","st":1424934772238,"mt":1424934771658}},"winreg-app-global":{"fiddlerhook@fiddler2.com":{"d":"C:\\Program Files\\Fiddler2\\FiddlerHook","e":false,"v":"2.4.8.3","st":1415012376210,"mt":1406724252000}}}
    1425038534487   addons.xpi  DEBUG   No changes found
    1425038534492   addons.xpi  DEBUG   Registering manifest for C:\Program Files\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
    1425038534493   addons.xpi  DEBUG   Loading bootstrap scope from C:\Program Files\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
    1425038534500   addons.xpi  DEBUG   Calling bootstrap method startup on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} version 7.3.16540.9015
    1425038534563   addons.manager  DEBUG   Registering shutdown blocker for XPIProvider
    1425038534563   addons.manager  DEBUG   Registering shutdown blocker for LightweightThemeManager
    1425038534565   addons.manager  DEBUG   Registering shutdown blocker for OpenH264Provider
    1425038534565   addons.manager  DEBUG   Registering shutdown blocker for PluginProvider
    JavaScript error: file:///C:/Users/pcs/AppData/Local/Temp/anonymous3272192605644315779webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js, line 11487: TypeError: this.server_ is undefined
    JavaScript error: chrome://fxdriver/content/server.js, line 38: NS_ERROR_XPC_CI_RETURNED_FAILURE: Component returned failure code: 0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE) [nsIJSCID.createInstance]
    *** Blocklist::_preloadBlocklistFile: blocklist is disabled
    1425038536584   addons.manager  DEBUG   Registering shutdown blocker for <unnamed-provider>
    console.error: skype_ff_extension: 
      DEPRECATED: The widget module is deprecated.  Please consider using the sdk/ui module instead.
    Traceback (most recent call last):
      File "resource://gre/modules/Promise-backend.js", line 870, in Handler.prototype.process
        nextValue = this.onResolve.call(undefined, nextValue);
      File "resource://gre/modules/commonjs/sdk/addon/runner.js", line 86, in startup/</<
        run(options);
      File "resource://gre/modules/commonjs/sdk/addon/runner.js", line 145, in run
        let program = main(options.loader, options.main);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 684, in main
        return loader.load(loader, module).exports;
      File "resource://gre/modules/commonjs/sdk/loader/cuddlefish.js", line 129, in CuddlefishLoader/options<.load
        result = load(loader, module);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 318, in load
        evaluate(sandbox, module.uri);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 267, in evaluate
        : loadSubScript(uri, sandbox, encoding);
      File "resource://skype_ff_extension-at-jetpack/skype_ff_extension/lib/main.js", line 14, in null
        var widgets = require("sdk/widget");
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 591, in require
        freeze(load(loader, module));
      File "resource://gre/modules/commonjs/sdk/loader/cuddlefish.js", line 129, in CuddlefishLoader/options<.load
        result = load(loader, module);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 318, in load
        evaluate(sandbox, module.uri);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 267, in evaluate
        : loadSubScript(uri, sandbox, encoding);
      File "resource://gre/modules/commonjs/sdk/widget.js", line 59, in null
        require("./util/deprecate").deprecateUsage(
      File "resource://gre/modules/commonjs/sdk/util/deprecate.js", line 18, in deprecateUsage
        let stack = get().slice(2);
    JavaScript error: resource://skype_ff_extension-at-jetpack/skype_ff_extension/data/c2c_options_menu_localization.js, line 189: TypeError: document.getElementById(...) is null

    Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:03:00'
    System info: host: 'pcs-PC', ip: '192.168.1.64', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_25'
    Driver info: driver.version: FirefoxDriver
        at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:130)
        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 erewards.erewards_admin.main(erewards_admin.java:14)
    Caused by: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
    DAD38A}":{"d":"C:\\Program Files\\Mozilla Firefox\\browser\\extensions\\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi","e":true,"v":"7.3.16540.9015","st":1405342340000},"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"C:\\Program Files\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","e":true,"v":"36.0","st":1424934772238,"mt":1424934771658}},"winreg-app-global":{"fiddlerhook@fiddler2.com":{"d":"C:\\Program Files\\Fiddler2\\FiddlerHook","e":false,"v":"2.4.8.3","st":1415012376210,"mt":1406724252000}}}
    1425038534487   addons.xpi  DEBUG   No changes found
    1425038534492   addons.xpi  DEBUG   Registering manifest for C:\Program Files\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
    1425038534493   addons.xpi  DEBUG   Loading bootstrap scope from C:\Program Files\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
    1425038534500   addons.xpi  DEBUG   Calling bootstrap method startup on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} version 7.3.16540.9015
    1425038534563   addons.manager  DEBUG   Registering shutdown blocker for XPIProvider
    1425038534563   addons.manager  DEBUG   Registering shutdown blocker for LightweightThemeManager
    1425038534565   addons.manager  DEBUG   Registering shutdown blocker for OpenH264Provider
    1425038534565   addons.manager  DEBUG   Registering shutdown blocker for PluginProvider
    JavaScript error: file:///C:/Users/pcs/AppData/Local/Temp/anonymous3272192605644315779webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js, line 11487: TypeError: this.server_ is undefined
    JavaScript error: chrome://fxdriver/content/server.js, line 38: NS_ERROR_XPC_CI_RETURNED_FAILURE: Component returned failure code: 0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE) [nsIJSCID.createInstance]
    *** Blocklist::_preloadBlocklistFile: blocklist is disabled
    1425038536584   addons.manager  DEBUG   Registering shutdown blocker for <unnamed-provider>
    console.error: skype_ff_extension: 
      DEPRECATED: The widget module is deprecated.  Please consider using the sdk/ui module instead.
    Traceback (most recent call last):
      File "resource://gre/modules/Promise-backend.js", line 870, in Handler.prototype.process
        nextValue = this.onResolve.call(undefined, nextValue);
      File "resource://gre/modules/commonjs/sdk/addon/runner.js", line 86, in startup/</<
        run(options);
      File "resource://gre/modules/commonjs/sdk/addon/runner.js", line 145, in run
        let program = main(options.loader, options.main);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 684, in main
        return loader.load(loader, module).exports;
      File "resource://gre/modules/commonjs/sdk/loader/cuddlefish.js", line 129, in CuddlefishLoader/options<.load
        result = load(loader, module);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 318, in load
        evaluate(sandbox, module.uri);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 267, in evaluate
        : loadSubScript(uri, sandbox, encoding);
      File "resource://skype_ff_extension-at-jetpack/skype_ff_extension/lib/main.js", line 14, in null
        var widgets = require("sdk/widget");
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 591, in require
        freeze(load(loader, module));
      File "resource://gre/modules/commonjs/sdk/loader/cuddlefish.js", line 129, in CuddlefishLoader/options<.load
        result = load(loader, module);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 318, in load
        evaluate(sandbox, module.uri);
      File "resource://gre/modules/commonjs/toolkit/loader.js", line 267, in evaluate
        : loadSubScript(uri, sandbox, encoding);
      File "resource://gre/modules/commonjs/sdk/widget.js", line 59, in null
        require("./util/deprecate").deprecateUsage(
      File "resource://gre/modules/commonjs/sdk/util/deprecate.js", line 18, in deprecateUsage
        let stack = get().slice(2);
    JavaScript error: resource://skype_ff_extension-at-jetpack/skype_ff_extension/data/c2c_options_menu_localization.js, line 189: TypeError: document.getElementById(...) is null

        at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)
        ... 7 more

1 个答案:

答案 0 :(得分:2)

与Firefox 36.0.1和Selenium Firefox Driver 2.43.1类似的问题。将其更新为2.45.0解决了这个问题。