title: How to download a pdf file in chrome using selenium webdriver
body: <p>I want to download pdf in chrome using selenium. </p>
  
  <pre><code>System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")  
                 + System.getProperty("file.separator")
                 + "BrowserDrivers"
                 + System.getProperty("file.separator")
                 + "chromedriver.exe");
  
  String downloadFilepath = "C:\\Users\\Vinod\\Downloads";
  
  HashMap&lt;String, Object&gt; chromePrefs = new HashMap&lt;String, Object&gt;();
  chromePrefs.put("profile.default_content_settings.popups", 0);
  chromePrefs.put("download.default_directory", downloadFilepath);
  
  //Save Chrome Opions
  ChromeOptions options = new ChromeOptions();
  HashMap&lt;String, Object&gt; chromeOptionsMap = new HashMap&lt;String, Object&gt;();
  options.setExperimentalOption("prefs", chromePrefs);
  options.addArguments("--test-type");
  
  
  DesiredCapabilities cap = DesiredCapabilities.chrome();
  cap.setCapability(ChromeOptions.CAPABILITY, chromeOptionsMap);
  cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
  cap.setCapability(ChromeOptions.CAPABILITY, options);
  
  
  driver = new ChromeDriver(cap);
  driver.get(url);
  </code></pre>
  
  <p>I tried above code but its not working</p>