在firefox44中执行selenium webdriver(2.51)脚本时出现以下错误: webdriver可以打开浏览器,但不能打开带有url的空浏览器: https://www.mozilla.org/en-US/firefox/44.0.2/firstrun/learnmore/
任何人都可以帮助我。
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
ranjans\AppData\Local\Temp\anonymous5188298946682853621webdriver-profile\extensions\fxdriver@googlecode.com
1455279332288 addons.xpi DEBUG Ignoring file entry whose name is not a valid add-on ID: C:\Users\cranjans\AppData\Local\Temp\anonymous5188298946682853621webdriver-profile\extensions\webdriver-staging
1455279332288 addons.xpi INFO SystemAddonInstallLocation directory is missing
1455279332289 addons.xpi INFO Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{972ce4c6-7e08-4474-a285-3208198ce6fd}
1455279332289 addons.xpi DEBUG Skipping unavailable install location app-system-share
1455279332289 addons.xpi DEBUG Skipping unavailable install location app-system-local
1455279332289 addons.xpi DEBUG checkForChanges
1455279332290 addons.xpi DEBUG Loaded add-on state from prefs: {"app-profile":{"fxdriver@googlecode.com":{"d":"C:\\Users\\cranjans\\AppData\\Local\\Temp\\anonymous5188298946682853621webdriver-profile\\extensions\\fxdriver@googlecode.com","e":false,"v":"2.45.0","st":1455279330232,"mt":1455279330062}},"app-global":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","e":true,"v":"44.0.2","st":1455258340685,"mt":1455258340500}}}
1455279332291 addons.xpi DEBUG Existing add-on fxdriver@googlecode.com in app-profile
1455279332291 addons.xpi DEBUG getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1455279332292 addons.xpi DEBUG Existing add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} in app-global
1455279332292 addons.xpi DEBUG getInstallState changed: false, state: {"app-profile":{"fxdriver@googlecode.com":{"d":"C:\\Users\\cranjans\\AppData\\Local\\Temp\\anonymous5188298946682853621webdriver-profile\\extensions\\fxdriver@googlecode.com","e":false,"v":"2.45.0","st":1455279330232,"mt":1455279330062}},"app-global":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","e":true,"v":"44.0.2","st":1455258340685,"mt":1455258340500}}}
1455279332293 addons.xpi DEBUG No changes found
1455279332299 addons.manager DEBUG Registering shutdown blocker for XPIProvider
1455279332299 addons.manager DEBUG Provider finished startup: XPIProvider
1455279332299 addons.manager DEBUG Starting provider: LightweightThemeManager
1455279332299 addons.manager DEBUG Registering shutdown blocker for LightweightThemeManager
1455279332300 addons.manager DEBUG Provider finished startup: LightweightThemeManager
1455279332300 addons.manager DEBUG Starting provider: GMPProvider
1455279332304 addons.manager DEBUG Registering shutdown blocker for GMPProvider
1455279332305 addons.manager DEBUG Provider finished startup: GMPProvider
1455279332305 addons.manager DEBUG Starting provider: PluginProvider
1455279332305 addons.manager DEBUG Registering shutdown blocker for PluginProvider
1455279332305 addons.manager DEBUG Provider finished startup: PluginProvider
1455279332305 addons.manager DEBUG Completed startup sequence
1455279332384 addons.xpi-utils DEBUG Starting async load of XPI database C:\Users\cranjans\AppData\Local\Temp\anonymous5188298946682853621webdriver-profile\extensions.json
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
1455279332479 addons.manager DEBUG Starting provider: <unnamed-provider>
1455279332479 addons.manager DEBUG Registering shutdown blocker for <unnamed-provider>
1455279332479 addons.manager DEBUG Provider finished startup: <unnamed-provider>
1455279332580 addons.xpi-utils DEBUG Async JSON file read took 0 MS
1455279332580 addons.xpi-utils DEBUG Finished async read of XPI database, parsing...
1455279332581 addons.xpi-utils DEBUG Successfully read XPI database
1455279332645 addons.manager DEBUG Starting provider: PreviousExperimentProvider
1455279332645 addons.manager DEBUG Registering shutdown blocker for PreviousExperimentProvider
1455279332645 addons.manager DEBUG Provider finished startup: PreviousExperimentProvider
答案 0 :(得分:0)
由于新的硒问题正在发生。您需要setPreference
作为xpinstall.signatures.required", false
,然后必须在selenium对象中传递它。
以下是适用于我的代码。参考相同的
WebDriver driver = null;
final FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.setPreference("xpinstall.signatures.required", false);
driver = new FirefoxDriver(firefoxProfile);
driver.get("YOUR URL");
希望它会对你有所帮助:)。
答案 1 :(得分:0)
是的,你需要做的就是让它继续工作就是停止在Firefox中使用本机导航事件,并制作一个能够导航页面的JavascriptExecutor。然后,你会发现它会起作用。如果要使用该原生导航事件,则需要降级到Firefox 31.6.0 ESR。您可以尝试更高版本的ESR,但我怀疑它也不适合您。