0

I am facing issue with the proxy prompts for firefox browser with version 17. I tried the steps mentioned in this link. But still am getting the prompts. Also referred selenium document for using proxies, but unable to succeed.

I need to use FF17 only as per my project req and am using selenium 2.28. My company proxy addr is proxy.comp_name.com port: 8080.

I am not getting any proxy prompts while doing manually.

While running multiple tests prompt will be displayed arbitrarily. Any updates on the below issue?

code used to launch the driver with the default firefox profile

FirefoxProfile profile = new ProfilesIni().getProfile("default");
DesiredCapabilities dCap = DesiredCapabilities.firefox();
dCap.setCapability(FirefoxDriver.PROFILE, profile);
driver = new FirefoxDriver(dCap);

code used to launch the driver with the new profile:

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

Also I tried by setting Preferences to the firefox profile, but still am getting the proxy prompts..

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);
Community
  • 1
  • 1
user1787641
  • 331
  • 2
  • 8
  • 25

1 Answers1

0
Proxy proxy = new Proxy();

proxy.setProxyAutoconfigUrl(""); 

// We use firefox as an example here.

DesiredCapabilities capabilities = DesiredCapabilities.firefox();

capabilities.setCapability(CapabilityType.PROXY, proxy); 

// You could use any webdriver implementation here

WebDriver driver = new FirefoxDriver(capabilities);
  • I tried by setting url to the proxy,its saying connection refused due to timeout, server is taking more time to respond. – user1787641 Jul 08 '13 at 13:21