package com.selenium.test; import org.openqa.selenium.ie.InternetExplorerDriver; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; public class TempGoogle { public static void main(String[] args) { final String sUrl = "http://www.google.com.hk/"; System.setProperty("webdriver.ie.driver","C:\\Users\\yren9\\workspace\\selenium\\IEDriverServer.exe"); DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer(); ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true); WebDriver oWebDriver = new InternetExplorerDriver(ieCapabilities); oWebDriver.get(sUrl); try { Thread.sleep(1000); } catch (InterruptedException e) { /
selenium chrome driver 和IE driver 常见问题(2)
最新推荐文章于 2019-04-04 10:17:00 发布
本文档展示了在使用Selenium自动化测试时,如何配置Chrome和Internet Explorer的驱动程序。针对IE,特别强调了需要设置'webdriver.ie.driver'系统属性,并提供了错误处理的示例,同时提醒用户从Selenium官方网站下载最新的IEDriverServer.exe并将其路径添加到系统路径中。
摘要由CSDN通过智能技术生成