I've been trying for days to setup a private proxy (with authentication) in Selenium using Firefox. However, no matter what I do I'v been unsuccessful.
Currently, I have tried the following two approaches and in both cases Firefox launches normally without any proxy.
Proxy proxy = new Proxy();
proxy.setHttpProxy(proxyHost + proxyPort);
proxy.setSocksUsername(proxyUsername);
proxy.setSocksPassword(proxyPass);
DesiredCapabilities cap = DesiredCapabilities.firefox();
cap.setCapability(CapabilityType.PROXY, proxy);
WebDriver driver = new FirefoxDriver(cap);
driver.get("http://google.com");
I have also tried the following:
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("network.proxy.type", 1);
profile.setPreference("network.proxy.http", proxyHost);
profile.setPreference("network.proxy.http_port", proxyPort);
profile.setPreference("network.proxy.http", "user:pass@1.1.1.1");
profile.setPreference("network.proxy.http_port", proxyPort);
WebDriver driver = new FirefoxDriver(profile);
driver.get("http://google.com");
How can I setup http private proxies (with user name and password in Selenium with Firefox)?
I am using Java.
Thanks