Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy not working #3333

Closed
guillaumeguerin opened this issue Jan 7, 2017 · 1 comment
Closed

Proxy not working #3333

guillaumeguerin opened this issue Jan 7, 2017 · 1 comment

Comments

@guillaumeguerin
Copy link

Meta -

OS:
Windows 7 64bit
Selenium Version:
3.0.1
Browser:
Firefox & Chrome

Browser Version:
Firefox : 50.1.0 & Chrome : 55.0.2883.87 m

Expected Behavior -

The website shows my proxy's IP adress

Actual Behavior -

The website shows my own IP adress

Steps to reproduce -

Code for Firefox

  public static void ProxyUsingFirefoxDriver()
    {
    	System.setProperty("webdriver.gecko.driver", "C:\\geckodriver\\geckodriver.exe");
        //Create a new Firefox profile
        FirefoxProfile firefoxProfile = new FirefoxProfile();
        //Then add the proxy setting to the Firefox profile we created
        firefoxProfile.setPreference("network.proxy.http", "198.2.202.40");
        firefoxProfile.setPreference("network.proxy.http_port", "8090");
        //Then create a new Firefox Driver passing in the profile we created
        //WebDriver we open a Firefox using this profile now
        FirefoxDriver Driver = new FirefoxDriver(firefoxProfile);

        //Navigate to a url and look at the traffic being logged in Fiddler.
        Driver.navigate().to("https://whatismyipaddress.com/");
    }

Code for Chrome

    public static void ProxyUsingChromeDriver()
    {
        //Set the location of the ChromeDriver
        System.setProperty("webdriver.chrome.driver", "C:\\geckodriver\\chromedriver.exe");
        //Create a new desired capability
        DesiredCapabilities capabilities = DesiredCapabilities.chrome();
        // Create a new proxy object and set the proxy
        Proxy proxy = new Proxy();
        proxy.setHttpProxy("198.2.202.40:8090");
        //Add the proxy to our capabilities 
        capabilities.setCapability("proxy", proxy);
        //Start a new ChromeDriver using the capabilities object we created and added the proxy to
        ChromeDriver Driver = new ChromeDriver(capabilities);

        //Navigation to a url and a look at the traffic logged in fiddler
        Driver.navigate().to("https://whatismyipaddress.com/");
    }
@barancev
Copy link
Member

barancev commented Jan 7, 2017

For chromedriver raise an issue here: https://sites.google.com/a/chromium.org/chromedriver/help

For geckodriver watch this issue: mozilla/geckodriver#97

@barancev barancev closed this as completed Jan 7, 2017
@lock lock bot locked and limited conversation to collaborators Aug 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants