1、火狐、谷歌和IE浏览器引擎都要重新下载selenium官网引擎,并设置路径才可以支持selenium3
而狐火用自己的引擎不用设置路径既可以支持selenium2也支持selenium3,谷歌和IE就不行
package Testpakage;
import org.openqa.selenium.*;
import org.openqa.selenium.WebDriver.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxDriver.*;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.safari.SafariDriver;
public class Mytest {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver", "C:\Users\Administrator\Downloads\geckodriver-v0.8.0-win32\geckodriver.exe");
WebDriver driver=new FirefoxDriver();
// System.setProperty("webdriver.ie.driver", "C:\Program Files\Internet Explorer\IEDriverServer.exe");
// WebDriver driver=new InternetExplorerDriver();
//
// System.setProperty("webdriver.chrome.driver", "C:\Program Files\Google\Chrome\Application\chromedriver.exe");
// WebDriver driver=new ChromeDriver();
driver.get("https://www.baidu.com/");
driver.quit();
}
}