简体   繁体   中英

Selenium 2: Unable to set PROXY for Internet Explorer

I want to set proxy and open IE (version 9, selenium 2.25) but this is not working for IE, though it is working for Firefox.

Here is my code:

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/"); 

Following run time error occurred:

Aug 16, 2012 2:00:13 PM org.openqa.selenium.browserlaunchers.WindowsProxyManager backupRegistrySettings

INFO: Backing up registry settings...

The message you get is just right - it is no exception (but an informational message). To use IE via Selenium, some specific settings will be changed in the Registry (only for Selenium runs, BTW - and the registry will be restored afterwards).

Do you have the rights to change your registry (check if you can run regedit)?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM