title: How to start OWASP ZAP proxy with Chrome webdriver and java?
body: <p>I download today (13-05-2020) a new OWASP ZAP. I regenerate root CA certificate. I configure local proxy to localhost:8092</p>
  
  <p><a href="https://i.stack.imgur.com/IHtdB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IHtdB.png" alt="enter image description here"></a></p>
  
  <p>After un run a simple java code:</p>
  
  <pre><code>public static void main(String[] args) throws InterruptedException {
  
      Proxy proxy = new Proxy();
      proxy.setAutodetect(false);
      proxy.setHttpProxy("localhost:8092");
      proxy.setSslProxy("localhost:8092");
  
      final OperatingSystem currentOperatingSystem = OperatingSystem.getCurrentOperatingSystem();
      String pathWebdriver = String.format("src/test/resources/drivers/%s/googlechrome/%s/chromedriver%s", currentOperatingSystem.getOperatingSystemDir(),
              SystemArchitecture.getCurrentSystemArchitecture().getSystemArchitectureName(), currentOperatingSystem.getSuffixBinary());
  
      if (!new File(pathWebdriver).setExecutable(true)) {
          logger.error("ERROR when change setExecutable on " + pathWebdriver);
      }
  
      System.setProperty("webdriver.chrome.driver", pathWebdriver);
      final ChromeOptions chromeOptions = new ChromeOptions();
      chromeOptions.addArguments("--ignore-certificate-errors");
  
      chromeOptions.setCapability(CapabilityType.PROXY, proxy);
      chromeOptions.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
      chromeOptions.setCapability(CapabilityType.ACCEPT_INSECURE_CERTS, true);
  
      WebDriver driver = new ChromeDriver(chromeOptions);
      for (int i = 0; i &lt; 6; i++) {
          //driver.get("http://www.google.com/ncr");
  
          // www.google.com work (OWASP ZAP list all requests) but not localhost
          driver.get("http://localhost:8080/ui");
  
      }
      driver.quit();
  }
  </code></pre>
  
  <p>Selenium script run OK but OWASP ZAP don not intercept any requests.</p>
  
  <p><a href="https://i.stack.imgur.com/YO8di.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YO8di.png" alt="enter image description here"></a></p>