使用geckodriver V0.16.1
后显示错误浏览器已打开并且URL已打开,但在打开浏览器时显示以下错误:
1496729301597 geckodriver INFO收听127.0.0.1:26189
1496729302267 geckodriver :: marionette INFO启动浏览器 \?\ C:\ Program Files \ Mozilla Firefox \ firefox.exe with args [" -marionette"]
1496729302562 addons.manager ERROR启动失败:[ExceptioJavaScript 错误:资源://gre/modules/AddonManager.jsm,第1657行: NS_ERROR_NOT_INITIALIZED:AddonManager未初始化
n ..."组件返回失败代码:0x80070057 (NS_ERROR_ILLEGAL_VALUE)[nsIFile.create]" nsresult:" 0x80070057 (NS_ERROR_ILLEGAL_VALUE)"位置:" JS框架:: resource://gre/modules/FileUtils.jsm :: FileUtils_getDir :: line 70" 数据:否]堆栈跟踪: FileUtils_getDir()@ resource://gre/modules/FileUtils.jsm:70< FileUtils_getFile()@ resources://gre/modules/FileUtils.jsm:42< validateBlocklist()@ resource://gre/modules/AddonManager.jsm:671< startup()@ resource://gre/modules/AddonManager.jsm:834< startup()@ resource://gre/modules/AddonManager.jsm:3129< 观察()@resource://gre/components/addonManager.js:65
JavaScript错误:资源://gre/components/SanityTest.js,第65行: NS_ERROR_FILE_ACCESS_DENIED:组件返回失败代码: 0x80520015(NS_ERROR_FILE_ACCESS_DENIED)[nsIPrefService.savePrefFile]
JavaScript错误:资源://gre/modules/AddonManager.jsm,第2570行: NS_ERROR_NOT_INITIALIZED:AddonManager未初始化
1496729310139 Marionette INFO侦听端口50194
Jun 06,2017 11:38:30 AM org.openqa.selenium.remote.ProtocolHandshake 了createSession
信息:检测到的方言:W3C
我的代码如下:
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
WebDriver driver ;
System.setProperty("webdriver.gecko.driver","D:\\geckodriver-v0.16.1-win64\\geckodriver.exe");
driver = new FirefoxDriver();
driver.get("http://google.co.in");
}
答案 0 :(得分:0)
我可以知道您使用的是哪个selenium独立服务器版本?它应该可以正常使用3.4.0