package seleniumDemo;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class seleniumDemo {
public void init(){
System.setProperty("webdriver.firefox.marionette", "E:\\geckodriver\\geckodriver-v0.14.0-win64\\geckodriver.exe");
WebDriver dirver = new FirefoxDriver();
dirver.get("http://www.baidu.com");
}
public static void main(String[] args) {
// TODO Auto-generated method stub
seleniumDemo sd = new seleniumDemo();
sd.init();
}
}
Exception in thread "main" org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: WIN10
Build info: version: 'unknown', revision: '86a5d70', time: '2017-02-16 07:47:51 -0800'
System info: host: 'DELL', ip: '192.168.3.9', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:116)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:122)
at seleniumDemo.seleniumDemo.init(seleniumDemo.java:9)
at seleniumDemo.seleniumDemo.main(seleniumDemo.java:15)