Selenium webdriver 使用Firefox驱动程序处理代理提示时出现问题

Selenium webdriver 使用Firefox驱动程序处理代理提示时出现问题,selenium-webdriver,selenium-firefoxdriver,Selenium Webdriver,Selenium Firefoxdriver,我面临firefox浏览器版本17的代理提示问题。 我尝试了本文中提到的步骤。但我还是得到了提示。 还参考了selenium文档以使用代理,但无法成功 我只需要按照我的项目要求使用FF17,我正在使用selenium 2.28。 我的公司代理地址是proxy.comp_name.com端口:8080 手动操作时,我没有收到任何代理提示 运行多个测试时,将任意显示提示。 以下问题有更新吗 用于使用默认firefox配置文件启动驱动程序的代码 FirefoxProfile profile = new

我面临firefox浏览器版本17的代理提示问题。 我尝试了本文中提到的步骤。但我还是得到了提示。 还参考了selenium文档以使用代理,但无法成功

我只需要按照我的项目要求使用FF17,我正在使用selenium 2.28。 我的公司代理地址是proxy.comp_name.com端口:8080

手动操作时,我没有收到任何代理提示

运行多个测试时,将任意显示提示。 以下问题有更新吗

用于使用默认firefox配置文件启动驱动程序的代码

FirefoxProfile profile = new ProfilesIni().getProfile("default");
DesiredCapabilities dCap = DesiredCapabilities.firefox();
dCap.setCapability(FirefoxDriver.PROFILE, profile);
driver = new FirefoxDriver(dCap);
用于使用新配置文件启动驱动程序的代码:

String PROXY = "proxy.abc.com:8080";

org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
proxy.setHttpProxy(PROXY)
     .setFtpProxy(PROXY)
     .setSslProxy(PROXY);
DesiredCapabilities cap = new DesiredCapabailities();
cap.setCapability(CapabilityType.PROXY, proxy);
WebDriver driver = new FirefoxDriver(cap); 
此外,我还尝试设置firefox配置文件的首选项,但仍然得到代理提示

FirefoxProfile firefoxProfile = new FirefoxProfile();

firefoxProfile.setPreference("network.proxy.type", ProxyType.SYSTEM.ordinal());
firefoxProfile.setPreference("signon.autologin.proxy" , true );     
firefoxProfile.setEnableNativeEvents(false);
desiredCapabilities.setCapability(FirefoxDriver.PROFILE, firefoxProfile);

return new FirefoxDriver(desiredCapabilities);
//这里我们以firefox为例

DesiredCapabilities capabilities = DesiredCapabilities.firefox();

capabilities.setCapability(CapabilityType.PROXY, proxy); 
//您可以在这里使用任何webdriver实现

WebDriver driver = new FirefoxDriver(capabilities);

我尝试将url设置为代理,它说由于超时连接被拒绝,服务器需要更多的时间来响应。
WebDriver driver = new FirefoxDriver(capabilities);