0
我有Firefox v53.0.2 Selenium Webdriver 3.4.0 安裝了Geckodriver 0.16.1。Selenium Webdriver的AddonsManager啓動錯誤3.4.0
在運行測試腳本時,我收到以下錯誤:
1495619876437 geckodriver INFO Listening on 127.0.0.1:27938
1495619876783 geckodriver::marionette INFO Starting browser \\?
\C:\Program Files\Mozilla Firefox\firefox.exe with args ["-marionette"]
1495619878148 addons.manager ERROR startup failed: [Exception...
"Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE)
[nsIFile.create]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"
location: "JS frame :: resource://gre/modules/FileUtils.jsm ::
FileUtils_getDir :: lineJavaSc r7i0p"t edrartoar:: nroe]s oSutraccek:
/t/rgarcee/:m oFdiulleeUst/iAldsd_ogneMtaDniarg(e)[email protected],u
rlce://gre/modules/FileUtils.jsm:7i0n e< 1F6i5l7e:U
tNiSl_sE_RgReOtRF_iNlOeT(_)[email protected]:D/:/ gArdedonMan/amgoedru
liess /nFoitl eiUntiitlisa.ljiszme:d4
2
< validateBlocklist()@resource://gre/modules/AddonManager.jsm:671 <
startup()@resource://gre/modules/AddonManager.jsm:834 <
startup()@resource://gre/modules/AddonManager.jsm:3129 <
observe()@resource://gre/components/addonManager.js:65
1495619881253 Marionette INFO Listening on port 55174
JavaScript error: resource://gre/modules/AddonManager.jsm, line 2570:
NS_ERROR_NOT_INITIALIZED: AddonManager is not initialized
1495619882013 Marionette WARN TLS certificate errors will be ignored
for this session
May 24, 2017 3:28:02 PM org.openqa.selenium.remote.ProtocolHandshake
createSession
INFO: Detected dialect: W3C
JavaScript error:
https://www.gstatic.com/recaptcha/api2/r20170515161201/recaptcha__en.js,
line 372: Error: Missing required parameters: sitekey
我的代碼片段看起來像:
@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
System.setProperty("webdriver.gecko.driver","D:\\geckodriver.exe");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
System.setProperty("webdriver.gecko.driver","D:\\geckodriver.exe");
driver=new FirefoxDriver(capabilities);
baseUrl = "https://www.google.com/";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
問題是什麼,需要修改什麼呢?請幫助..