-1
這裏的錯誤:硒3.4加入的webdriver錯誤
1494724012420 geckodriver INFO Listening on 127.0.0.1:20810
1494724013022 geckodriver::marionette INFO Starting browser \\?\C:\Program Files\Mozilla Firefox\firefox.exe with args ["-marionette"]
1494724013271 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 :: line 70" data: no] Stack trace: FileUtils_getDir()@resource://gre/mJaovdauSlcersi/pFti leerUrtoirls.jsm:: 7r0e s<o uFriclee:U/t/iglrse_/gmeotdFuillees(/)[email protected]:e/r/.gjrsem/,m oldiunlee s1/6F5i7l:e UNtSi_lEsR.RjOsR_NOTm_:I4N2I T<I AvLaIlZiEdDa:t eABdldoocnkMlainsatg(e)[email protected] riess onuortc ei:n/i/tgirael/imzoeddu
l
es/AddonManager.jsm:671 < startup()@resource://gre/modules/AddonManager.jsm:834 < startup()@resource://gre/modules/AddonManager.jsm:3129 < observe()@resource://gre/components/addonManager.js:65
1494724014515 Marionette INFO Listening on port 64478
JavaScript error: resource://gre/modules/AddonManager.jsm, line 2570: NS_ERROR_NOT_INITIALIZED: AddonManager is not initialized
maj 14, 2017 3:06:54 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
JavaScript error: resource://gre/modules/FileUtils.jsm, line 70: NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIFile.create]
我的代碼:
public class OpenBrowser {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver", "C:/Users/E/workspace/RocketTradingBot/lib/geckodriver/geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("https://google.com/");
//driver.quit();
}
}
可能是什麼這個錯誤,以及如何解決它的原因是什麼?
確保您geckodriver版本是0.1 5或以上也是你的Firefox是V53或以上 – kushal
什麼是你的geckodriver和Mozilla Firefox版本? – DebanjanB