Unable to set the proxy setting in Mozilla browser | Selenium Forum
M
Posted on 05/10/2016
I am using latest version of selenium 3.0.0-beta4 and latest version of Mozilla Firefox v.49.0.1 in window 10 OS.
I am unable to do the proxy setting with the code below. Both ProfileIni and Proxy code doesn't work. let me know where i am going wrong.

Note:For ProfileIni I am creating a new profile with the command firefox.exe -p

import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;

public class Proxy_example {

public static void main(String[] args) {


System.setProperty("webdriver.gecko.driver", "C:/Tools/TestingTools/selenium/geckodriver.exe");

ProfilesIni prof=new ProfilesIni();
FirefoxProfile seleniumProfile=prof.getProfile("Selenium");
WebDriver driver=new FirefoxDriver(seleniumProfile);
//driver.quit();


/* ***Proxy code****
Proxy p = new Proxy();
p.setProxyAutoconfigUrl("https://www.proxfree.com/proxy/");

DesiredCapabilities cap = new DesiredCapabilities();

cap.setCapability(CapabilityType.PROXY,p );
System.setProperty("webdriver.gecko.driver", "C:/Tools/TestingTools/selenium/geckodriver.exe");
WebDriver driver = new FirefoxDriver(cap);
driver.get("http://bbc.com");*/

}

}

M
Replied on 07/10/2016

this is how you use proxy

http://www.software-testing-tutorials-automation.com/2015/03/how-to-set-proxy-settings-in-selenium.html