Skip to content

Instantly share code, notes, and snippets.

@FriendlyTester
Created October 16, 2014 11:42
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/654c0476c9fc69c73ce7 to your computer and use it in GitHub Desktop.
Save FriendlyTester/654c0476c9fc69c73ce7 to your computer and use it in GitHub Desktop.
public void ProxyUsingChromeDriver()
{
//Set the location of the ChromeDriver
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Richard\\Desktop\\chromedriver.exe");
//Create a new desired capability
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
// Create a new proxy object and set the proxy
Proxy proxy = new Proxy();
proxy.setHttpProxy("localhost:8888");
//Add the proxy to our capabilities
capabilities.setCapability("proxy", proxy);
//Start a new ChromeDriver using the capabilities object we created and added the proxy to
ChromeDriver Driver = new ChromeDriver(capabilities);
//Navigation to a url and a look at the traffic 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