Created
October 16, 2014 11:27
-
-
Save FriendlyTester/142adce94926dd20e677 to your computer and use it in GitHub Desktop.
Proxy Using FirefoxDriver In Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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