Skip to content

Instantly share code, notes, and snippets.

@FriendlyTester
Created October 16, 2014 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FriendlyTester/142adce94926dd20e677 to your computer and use it in GitHub Desktop.
Save FriendlyTester/142adce94926dd20e677 to your computer and use it in GitHub Desktop.
Proxy Using FirefoxDriver In Java
public void ProxyUsingFirefoxDriver()
{
//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", "localhost");
firefoxProfile.setPreference("network.proxy.http_port", "8888");
//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("http://bbc.co.uk");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment