Firefox浏览器未加载并显示错误:typeError:addon为null [英] Firefox browser is not loading with Error: typeError: addon is null
本文介绍了Firefox浏览器未加载并显示错误:typeError:addon为null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
public class firstTest {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver", "E:\\SOFTWARE\\drivers\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
}
}
在执行上述代码时,出现以下错误:
While executing above code I am getting following error :
Unable to read VR Path Registry from C:\Users\DEEPAK D P\AppData\Local\openvr\openvrpaths.vrpath
JavaScript error: resource://gre/modules/addons/XPIProvider.jsm, line 3345: TypeError: addon is null
1521607690370 addons.productaddons INFO sending request to: https://aus5.mozilla.org/update/3/GMP/59.0.1/20180315233128/WINNT_x86_64-msvc-x64/en-GB/release/Windows_NT%2010.0.0.0.16299.125%20(x64)/default/default/update.xml
1521607691520 addons.productaddons INFO Completed downloading document
1521607692630 addons.productaddons INFO downloadXHR File download. status=200
1521607692638 addons.productaddons INFO Downloaded file will be saved to C:\Users\DEEPAK~1\AppData\Local\Temp\tmpaddon-c492c1
1521607698968 addons.productaddons INFO downloadXHR File download. status=200
1521607698976 addons.productaddons INFO Downloaded file will be saved to C:\Users\DEEPAK~1\AppData\Local\Temp\tmpaddon-47ef79
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 tests.firstTest.main(firstTest.java:22)
Exception in thread "main" org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files (x86)\Mozilla Firefox\firefox.exe) on port 7055; process output follows:
driver@googlecode.com
1521607670798 addons.xpi DEBUG Ignoring file entry whose name is not a valid add-on ID: C:\Users\xxx \AppData\Local\Temp\anonymous4306519380516409248webdriver-profile\extensions\webdriver-staging
1521607670798 addons.xpi DEBUG Existing add-on fxdriver@googlecode.com in app-profile
1521607670800 addons.xpi INFO Mapping activity-stream@mozilla.org to C:\Program Files (x86)\Mozilla Firefox\browser\features\activity-stream@mozilla.org.xpi
1521607670800 addons.xpi INFO Mapping aushelper@mozilla.org to C:\Program Files (x86)\Mozilla Firefox\browser\features\aushelper@mozilla.org.xpi
1521607670800 addons.xpi INFO Mapping firefox@getpocket.com to C:\Program Files (x86)\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1521607670800 addons.xpi INFO Mapping followonsearch@mozilla.com to C:\Program Files (x86)\Mozilla Firefox\browser\features\followonsearch@mozilla.com.xpi
1521607670800 addons.xpi INFO Mapping formautofill@mozilla.org to C:\Program Files (x86)\Mozilla Firefox\browser\features\formautofill@mozilla.org.xpi
1521607670800 addons.xpi INFO Mapping onboarding@mozilla.org to C:\Program Files (x86)\Mozilla Firefox\browser\features\onboarding@mozilla.org.xpi
1521607670800 addons.xpi INFO Mapping screenshots@mozilla.org to C:\Program Files (x86)\Mozilla Firefox\browser\features\screenshots@mozilla.org.xpi
1521607670800 addons.xpi INFO Mapping shield-recipe-client@mozilla.org to C:\Program Files (x86)\Mozilla Firefox\browser\features\shield-recipe-client@mozilla.org.xpi
1521607670800 addons.xpi INFO Mapping webcompat@mozilla.org to C:\Program Files (x86)\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi
1521607670802 addons.xpi DEBUG Existing add-on activity-stream@mozilla.org in app-system-defaults
1521607670802 addons.xpi DEBUG Existing add-on aushelper@mozilla.org in app-system-defaults
1521607670802 addons.xpi DEBUG Existing add-on firefox@getpocket.com in app-system-defaults
1521607670802 addons.xpi DEBUG Existing add-on followonsearch@mozilla.com in app-system-defaults
1521607670802 addons.xpi DEBUG Existing add-on formautofill@mozilla.org in app-system-defaults
1521607670804 addons.xpi DEBUG Existing add-on onboarding@mozilla.org in app-system-defaults
1521607670804 addons.xpi DEBUG Existing add-on screenshots@mozilla.org in app-system-defaults
1521607670804 addons.xpi DEBUG Existing add-on shield-recipe-client@mozilla.org in app-system-defaults
1521607670804 addons.xpi DEBUG Existing add-on webcompat@mozilla.org in app-system-defaults
1521607670806 addons.xpi INFO Mapping {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} to C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}.xpi
1521607670806 addons.xpi INFO Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
1521607670806 addons.xpi DEBUG Existing add-on {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A} in app-global
1521607670806 addons.xpi DEBUG Existing add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} in app-global
1521607670806 addons.xpi DEBUG getInstallState changed: false, state: {}
Unable to read VR Path Registry from C:\Users\DEEPAK D P\AppData\Local\openvr\openvrpaths.vrpath
JavaScript error: resource://gre/modules/addons/XPIProvider.jsm, line 3345: TypeError: addon is null
1521607690370 addons.productaddons INFO sending request to: https://aus5.mozilla.org/update/3/GMP/59.0.1/20180315233128/WINNT_x86_64-msvc-x64/en-GB/release/Windows_NT%2010.0.0.0.16299.125%20(x64)/default/default/update.xml
1521607691520 addons.productaddons INFO Completed downloading document
1521607692630 addons.productaddons INFO downloadXHR File download. status=200
1521607692638 addons.productaddons INFO Downloaded file will be saved to C:\Users\DEEPAK~1\AppData\Local\Temp\tmpaddon-c492c1
1521607698968 addons.productaddons INFO downloadXHR File download. status=200
1521607698976 addons.productaddons INFO Downloaded file will be saved to C:\Users\DEEPAK~1\AppData\Local\Temp\tmpaddon-47ef79
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:59:12'
System info: host: 'xxx', ip: '192.168.43.34', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_40'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:134)
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 tests.firstTest.main(firstTest.java:22)
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:
driver@googlecode.com
1521607670798 addons.xpi DEBUG Ignoring file entry whose name is not a valid add-on ID: C:\Users\DEEPAK D P\AppData\Local\Temp\anonymous4306519380516409248webdriver-profile\extensions\webdriver-staging
1521607670798 addons.xpi DEBUG Existing add-on fxdriver@googlecode.com in app-profile
推荐答案
错误说明了一切:
Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:59:12'
System info: host: 'xxx', ip: '192.168.43.34', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_40'
Driver info: driver.version: FirefoxDriver
错误跟踪日志明确提到 Browser Client 无法识别回 FirefoxDriver 二进制文件.
The error trace logs clearly mention that Browser Client is unable to recognize back the FirefoxDriver binary.
您的主要问题是所使用的二进制文件之间的版本兼容性:
Your main issue is the version compatibility between the binaries you are using as follows :
- 您的 Selenium Client 版本是 2015-10-09 19:59:12 的 2.48.2 ,几乎是 2.5岁.
- 您的 JDK版本是 1.8.0_40 ,这很古老.
- 您不知道您的 GeckoDriver 版本.
- 您不知道您的 Firefox 版本.
- Your Selenium Client version is 2.48.2 of 2015-10-09 19:59:12 which is almost 2.5 years older.
- Your JDK version is 1.8.0_40 which is pretty ancient.
- Your GeckoDriver version is unknown to us.
- Your Firefox version is unknown to us.
因此 JDK v8u40 和 Selenium Client v2.48.2 之间存在明显的不匹配.
So there is a clear mismatch between the JDK v8u40 , Selenium Client v2.48.2.
- 将 JDK 升级到最新级别 JDK 8u162 .
- 将硒升级到当前级别> 版本3.11.0 > .
- 将 GeckoDriver 升级到 GeckoDriver v0.20.0 级.
- 将 Firefox 版本升级到 Firefox v59.0.1 级别. 通过 IDE
- 清理您的项目工作区和重建您的项目,并且仅具有必需的依赖项.
- 使用 CCleaner 工具清除之前和之后的所有操作系统杂项在执行 test Suite 之后.
- 如果您的基本 Firefox 基本版本太旧,请通过卸载它 Revo Uninstaller 并安装最新的GA和 Firefox 发行版本.
- 执行您的
@Test
.
- Upgrade JDK to recent levels JDK 8u162.
- Upgrade Selenium to current levels Version 3.11.0.
- Upgrade GeckoDriver to GeckoDriver v0.20.0 level.
- Upgrade Firefox version to Firefox v59.0.1 levels.
- Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
- Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
- If your base Firefox base version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Firefox.
- Execute your
@Test
.
这篇关于Firefox浏览器未加载并显示错误:typeError:addon为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文