mozilla/geckodriver

Proxy Not Working in GeckoDriver - Using Zap Tools to Verify

newton143 opened this issue · 4 comments

GeckoDriver Version

geckodriver-v0.15.0-win64

Firefox Version

FireFox Nightly 55.0a1 (2017-04-19) (64-bit)

Platform

Windows

Steps to reproduce -

Install Zap tools (Win64) from https://github.com/zaproxy/zaproxy/wiki/Downloads
Set Tools > Options > LocalProxy as
Address: localhost
Port: 8080
Tried below two cases, using firefox latest nightly browser 55, proxy is not working, in other words its not detected in Zap tools, please help me to find the issue.

Note: I'm not getting any exception.

Case1:
FirefoxOptions options = new FirefoxOptions();
options.SetPreference("network.proxy.http", "localhost");
options.SetPreference("network.proxy.http_port", "8080");
FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(Settings.DriverDirectory, "geckodriver.exe");
service.FirefoxBinaryPath = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";
TimeSpan time = TimeSpan.FromSeconds(10);
var proxy = new Proxy {HttpProxy = "localhost:8080"};
profile.SetProxyPreferences(proxy);
options.Profile = profile;
WebDriver = new FirefoxDriver(service, options, time);

Case2:
FirefoxProfile profile = new FirefoxProfile();
FirefoxOptions options = new FirefoxOptions();
options.SetPreference("network.proxy.http", "localhost");
options.SetPreference("network.proxy.http_port", "8080");
FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(Settings.DriverDirectory, "geckodriver.exe");
service.FirefoxBinaryPath = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";
TimeSpan time = TimeSpan.FromSeconds(10);
profile.SetPreference("network.proxy.http", "localhost");
profile.SetPreference("network.proxy.http_port", "8080");
options.Profile = profile;
WebDriver = new FirefoxDriver(service, options, time);

But in chrome its working fine
var proxy = new Proxy {HttpProxy = "localhost:8080"};
chromeOptions.Proxy = proxy;
WebDriver = new ChromeDriver(Settings.DriverDirectory, chromeOptions);

Please attach a trace-level log from geckodriver to help us debug the problem.

Just added below line, issue is resolved
options.UseLegacyImplementation = false;

@newton143 That’s not really a solution as it disables geckodriver/Marionette.

I’m going to close this as the information requested was not added. However, I’m happy to re-open if you add this.

lock commented

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue.