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



我想在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所需的所有设置。

我能够通过网络驱动程序使用IE浏览器,而无需使用代理配置。

我在带有IEDriver.exe 2.28.0版本的Windows 7上使用IE9。

有人可以建议我解决这个问题吗?任何帮助都非常感谢。

可能的解决方法:在IE中手动设置PAC文件。 只需启动IE驱动程序。 不好的部分是,如果您使用IE进行冲浪,您将不断切换它。

最新更新