我想设置代理并打开 IE(版本 9,selenium 2.25),但这不适用于 IE,尽管它适用于 Firefox。
这是我的代码:
String PROXY = "somehost.com" + ":" + "80";
org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
proxy.setHttpProxy(PROXY);
proxy.setFtpProxy(PROXY);
proxy.setSslProxy(PROXY);
DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
ieCapabilities.setCapability(CapabilityType.PROXY, proxy);
WebDriver driver = new InternetExplorerDriver(ieCapabilities);
driver.get("http://www.cnn.com/");
发生以下运行时错误:
2012 年 8 月 16 日下午 2:00:13 org.openqa.selenium.browserlaunchers.WindowsProxyManager backupRegistrySettings
信息:正在备份注册表设置...