admin管理员组

文章数量:1530517

前言

同chrome、firefox,ie浏览器的启动一样需要driver,但是IEDriver不像chromeDriver一样有多个版本,不同版本对应不同的chrome版本,它只有32位版本和64位版本两种;
下载地址为:https://www.seleniumhq/download/

启动IE浏览器

1、设置驱动

设置驱动代码如下,第二个参数即为驱动的路径,可以任意设定:

System.setProperty("webdriver.ie.driver", ".\\Tools\\IEDriverServer.exe");

2、简单启动IE浏览器

简单启动代码如下,不用带任何设置;

System.setProperty("webdriver.ie.driver", "D:\\test\\driver\\IEDriver_64.exe");
InternetExplorerDriver ie = new InternetExplorerDriver();
ie.get("https://www.baidu/");
System.out.println(ie.getTitle());
ie.quit();

3、定制启动之带Options

使用此种方法使用代码:

public static void main( String[] args )
    {
    
    	System.setProperty("webdriver.ie.driver", "D:\\test\\driver\\IEDriver_64.exe");
    	InternetExplorerOptions options = new

本文标签: 浏览器界面测试教程Java