title: How to set proxy for Chrome browser in selenium using Java code
body: <p>I am trying to run my selenium java code to test a webpage. But webpage is not loading because of network restrictions. When I set the proxy manually and hit the url in browser it works fine. Now I need to pass those proxy setting while running the selenium code. Please help me on this.</p>
  
  <p>I tried below code, but still it shows the same error:</p>
  
  <pre><code>Proxy p=new Proxy();
  
  
  // Set HTTP Port to 7777
  p.setHttpProxy("www.abc.com:8080");
  
  // Create desired Capability object
  DesiredCapabilities cap=new DesiredCapabilities();
  
  // Pass proxy object p
  cap.setCapability(CapabilityType.PROXY, p);
  
  // Open  firefox browser
  WebDriver driver=new ChromeDriver(cap);
  </code></pre>