代码:
public static void main(String[] args) {
// objects and variables instantiation
System.setProperty("webdriver.gecko.driver", "C:\\selenium-java-3.4.0\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
}
控制台:1502197016829 geckodriver INFO geckodriver 0.18.0 1502197016843 geckodriver INFO收听127.0.0.1:31751 1502197017814 geckodriver :: marionette INFO启动浏览器C:\ Program 带有args [“-marionette”]的文件(x86)\ Mozilla Firefox \ firefox.exe 1502197021151 Marionette INFO通过--marionette启用
答案 0 :(得分:0)
从以下网址下载新的geckodriver: -
https://github.com/mozilla/geckodriver/releases
替换新的selenium服务器和绑定jar。从以下URL下载罐子: -
http://www.seleniumhq.org/download/
更新您的Firefox浏览器: -
帮助 - >关于firefox
运行以下代码: -
public static void main(String[] args) {
// objects and variables instantiation
System.setProperty("webdriver.gecko.driver","C:\\selenium-java-3.4.0\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("https://google.com/");
}