[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/");
}
}
本文介绍如何使用Selenium中的FirefoxDriver与InternetExplorerDriver来自动化网页操作。FirefoxDriver能够直接打开并控制Firefox浏览器执行代码,而InternetExplorerDriver则专为Windows平台上的IE浏览器设计。
3232

被折叠的 条评论
为什么被折叠?



