Search code examples
firefoxproxyselenium-webdriverfoxyproxy

Webdriver and proxy server for firefox


are there any ways to set firefox's proxy settings? I found here information about FoxyProxy but when Selenium works, plugins are unactivated in window.


Solution

  • Look at the documentation page.

    Tweaking an existing Firefox profile

    You need to change "network.proxy.http" & "network.proxy.http_port" profile settings.

    FirefoxProfile profile = new FirefoxProfile();
    profile.addAdditionalPreference("network.proxy.http", "localhost");
    profile.addAdditionalPreference("network.proxy.http_port", "3128");
    WebDriver driver = new FirefoxDriver(profile);