相关疑难解决方法(0)

无法使用Selenium2(Webdriver)与Java一起启动IE浏览器

我无法启动IE浏览器来运行用Java编写的selenium自动化测试.我正在使用Windows 7和IE 9.以下是我的代码:

请找到附件.在此输入图像描述

public class GoogleNews {
    private WebDriver driver;
    private String baseUrl;
    private StringBuffer verificationErrors = new StringBuffer();
    ArrayList al = new ArrayList();
    @Before
    public void setUp() throws Exception {
        //driver = new FirefoxDriver();
        driver =new InternetExplorerDriver();
        baseUrl = "https://news.google.co.in/";

    }

    @Test
    public void testApple() throws Exception {
        driver.get(baseUrl);
    }
}
Run Code Online (Sandbox Code Playgroud)

java internet-explorer selenium-webdriver

56
推荐指数
3
解决办法
13万
查看次数