[b][size=large]FirefoxDriver[/size][/b]
FirefoxDriver能够直接打开firefox浏览器运行代码支持Javascript,执行速度比HtmlUnitDriver慢,比InternetExplorerDriver快。
[b][size=large]InternetExplorerDriver[/size][/b]
InternetExplorerDriver只能运行在windows操作系统下。
FirefoxDriver能够直接打开firefox浏览器运行代码支持Javascript,执行速度比HtmlUnitDriver慢,比InternetExplorerDriver快。
package selenium.test.googleSearch;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.*;
public class BaiduFirefoxDriver {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.firefox.bin", "D:\\Program Files\\Mozilla Firefox\\firefox.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.baidu.com/");
}
}
[b][size=large]InternetExplorerDriver[/size][/b]
InternetExplorerDriver只能运行在windows操作系统下。
package selenium.test.googleSearch;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class BaiduInternetExplorerDriver {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver driver = new InternetExplorerDriver();
driver.get("http://www.baidu.com/");
}
}