title: Save document in Chrome browser using Selenium
body: <p>I have a Selenium (Java) test application that opens pdf documents in the browser and saves them to the hard drive for use later in the test.  As the test is going to be used across multiple machines manually setting up profiles is not an option; it has to be done programmatically.</p>
  
  <p>In Firefox I set the profile preferences:</p>
  
  <pre><code>    FirefoxProfile profile = new FirefoxProfile();
      profile.setPreference("browser.download.manager.showWhenStarting", false);
      profile.setPreference("browser.download.dir", appSet.getDocumentSavePath());
      profile.setPreference("browser.download.folderList", 2);
      profile.setPreference("plugin.disable_full_page_plugin_for_types", "application/pdf");
      profile.setPreference("pref.downloads.disable_button.edit_actions", true);
      profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/pdf");
      profile.setPreference("pdfjs.disabled", true);
  </code></pre>
  
  <p>Is there an equivalent in Chrome?</p>
  
  <p>I know that there are capabilities in Chrome where I can set switches, but I don't see any that can help me.</p>
  
  <pre><code>DesiredCapabilities capabilities = DesiredCapabilities.chrome();
  capabilities.setCapability("chrome.binary", appSet.getChromeBinaryLocation());
  capabilities.setCapability("chrome.switches", Arrays.asList("--allow-running-insecure-   content=true"));
  </code></pre>