1
我想設置代理並打開IE(版本9,selenium 2.25),但這不適用於IE,儘管它適用於Firefox。Selenium 2:無法爲Internet Explorer設置PROXY
這裏是我的代碼:
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時零零分13秒org.openqa.selenium.browserlaunchers.WindowsProxyManager backupRegistrySettings
信息:備份註冊表設置...
謝謝您的回覆。其實下面的代碼會產生更多的錯誤: – BlueSky 2012-08-20 13:19:52