Created
October 16, 2014 11:42
-
-
Save FriendlyTester/654c0476c9fc69c73ce7 to your computer and use it in GitHub Desktop.
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 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