对于铬,
public class Chrome {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "E://chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com");
}
}
对于火狐,
public class Firefox {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
}
}
为什么我们需要system.setProperty
为 Chrome 和 IE 指定?