Selenium之IE浏览器的启动

1、下载IEDriverServer.exe文件放至需要的目录中;

2、编写代码

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;

/**
 * Created by Administrator on 2018/3/29 0029.
 */
public class IETest {
    public static void main(String[] args){
        WebDriver driver;
        //根据下载好的驱动地址进行配置
        System.setProperty("webdriver.ie.driver","D:\ztsoft\ieDriverServer\IEDriverServer.exe");
        //实例化一个对象Chrome
        driver = new InternetExplorerDriver();
        String testUrl = "http://www.baidu.com";
        driver.get(testUrl);
        //driver.quit();
    }
}

3、执行代码,弹出IE浏览器,地址栏中没有展示设置的地址,后续再看。参考:http://www.cnblogs.com/biyuting/p/8678679.html

原文地址:https://www.cnblogs.com/biyuting/p/8673306.html