使用selenium webdriver在Internet Explorer中进行代理配置

时间:2013-01-25 12:16:43

标签: selenium internet-explorer-9 webdriver selenium-webdriver

我想在webdriver的帮助下在Internet Explorer中设置一些代理设置。

目前我正在使用此代码:

System.setProperty("webdriver.ie.driver", "Path to IEDriverServer.exe");
    Proxy proxy = new Proxy();
    proxy.setProxyAutoconfigUrl("proxyhost:port");
    DesiredCapabilities capability = new DesiredCapabilities(); 
    capability.setBrowserName(DesiredCapabilities.internetExplorer().getBrowserName());
    capability.setCapability(CapabilityType.PROXY, proxy); 
    driver=new InternetExplorerDriver(capability);

但除了在控制台上发出此消息外,它什么也没做:

org.openqa.selenium.browserlaunchers.WindowsProxyManager backupRegistrySettings
INFO: Backing up registry settings...

我已完成与区域相关的设置以及使用IEDriver所需的所有设置。

我可以通过webdriver使用Internet Explorer而无需使用代理配置。

我在Windows 7上使用IE9和IEDriver.exe版本2.28.0。

有人可以建议我为此做些工作。非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

可能的解决方法:在IE中手动设置PAC文件。只需启动IEdriver。不好的是,如果你使用IE进行冲浪,你会继续切换它。