Created
October 16, 2014 11:04
-
-
Save FriendlyTester/897c776c1fcf14e627c8 to your computer and use it in GitHub Desktop.
C# Proxy Using Firefox Driver
This file contains hidden or 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 SettingUpAProxyUsingFirefoxDriver() | |
{ | |
//Create a new Firefox profile | |
var firefoxProfile = new FirefoxProfile(); | |
//Create a new proxy object | |
var proxy = new Proxy(); | |
//Set the http proxy value, host and port. | |
proxy.HttpProxy = "localhost:8888"; | |
//We then add this proxt setting to the Firefox profile we created | |
firefoxProfile.SetProxyPreferences(proxy); | |
//Then create a new Firefox Driver passing in the profile we created | |
//WebDriver we open a Firefox using this profile now | |
var Driver = new FirefoxDriver(firefoxProfile); | |
//Navigate to a url and look at the traffic being logged in Fiddler. | |
Driver.Navigate().GoToUrl("http://bbc.co.uk"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
public void LaunchMozilla()
{
var fireDriverService = FirefoxDriverService.CreateDefaultService();
var profileManager = new FirefoxProfileManager();
var proxy = new Proxy();
That's my code incase anyone is wondering if its any different with an imported profile (Its not).