我使用的是FF 52.0.1 Selenium 3.3.1 gecko driver 0.15.0

时间:2017-03-22 16:45:53

标签: java selenium firefox selenium-webdriver webdriver

我正在使用FF 52.0.1 Selenium 3.3.1 gecko driver v0.15.0

当我运行测试用例时,我得到了这个例外:

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
1490199380254   addons.manager  DEBUG   Application has been upgraded
1490199380292   addons.manager  DEBUG   Loaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider"]
1490199380294   addons.manager  DEBUG   Loaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]
1490199380298   addons.manager  DEBUG   Loaded provider scope for resource://gre/modules/addons/GMPProvider.jsm
1490199380300   addons.manager  DEBUG   Loaded provider scope for resource://gre/modules/addons/PluginProvider.jsm
1490199380300   addons.manager  DEBUG   Starting provider: XPIProvider
1490199380300   addons.xpi  DEBUG   startup
1490199380301   addons.xpi  INFO    Mapping fxdriver@googlecode.com to C:\Users\TGUDUG~1\AppData\Local\Temp\anonymous1718988216671391891webdriver-profile\extensions\fxdriver@googlecode.com
1490199380301   addons.xpi  DEBUG   Ignoring file entry whose name is not a valid add-on ID: C:\Users\TGUDUG~1\AppData\Local\Temp\anonymous1718988216671391891webdriver-profile\extensions\webdriver-staging
1490199380302   addons.xpi  INFO    SystemAddonInstallLocation directory is missing
1490199380302   addons.xpi  INFO    Mapping e10srollout@mozilla.org to C:\Program Files (x86)\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi
1490199380303   addons.xpi  INFO    Mapping firefox@getpocket.com to C:\Program Files (x86)\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1490199380303   addons.xpi  INFO    Mapping webcompat@mozilla.org to C:\Program Files (x86)\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi
1490199380304   addons.xpi  INFO    Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
1490199380304   addons.xpi  DEBUG   Skipping unavailable install location app-system-share
1490199380305   addons.xpi  DEBUG   Skipping unavailable install location app-system-local
1490199380305   addons.xpi  INFO    Mapping {f176abfa-5be8-4b97-b851-d694e62fde1f} to C:\Program Files (x86)\Zoiper\ClickToDial\FireFox
1490199380305   addons.xpi  DEBUG   checkForChanges
1490199380306   addons.xpi  DEBUG   Loaded add-on state from prefs: {}
1490199380306   addons.xpi  DEBUG   New add-on fxdriver@googlecode.com in app-profile

有人可以帮我吗?

2 个答案:

答案 0 :(得分:0)

Probably 7055 is used by some other process so you have to close that.

Search using this answer : How can you find out which process is listening on a port on Windows?

And close that process and try again.

答案 1 :(得分:0)

尝试使用64位Firefox 52版本并使用64位geckodriver用于selenium3.3.1和jdk1.8 64位

profile.setPreference("browser.tabs.remote.autostart", false); profile.setPreference("browser.tabs.remote.autostart.1", false); profile.setPreference("browser.tabs.remote.autostart.2", false); profile.setPreference("browser.tabs.remote.force-enable", "false");