title: Chromedriver, Selenium - Automate downloads
body: <p>I am using Selenium 2.43.0 with Python 2.7.5.  At one point, the test clicks on a button which sends form information to the server.  If the request is successful, the server responds with</p>
  
  <p>1) A successful message</p>
  
  <p>2) A PDF with the form information merged in</p>
  
  <p>I don't care to test the PDF, my test is just looking for a successful message.  However the PDF is part of the package response from the server that I, as the tester, cannot change.</p>
  
  <p>Until recently, this was never an issue using Chromedriver, since Chrome would automatically download pdfs into its default folder.</p>
  
  <p>However, a few days ago one of my test environments started popping a separate window with a "Print" screen for the pdf, which derails my tests.  </p>
  
  <p>I don't want or need this dialog.  How do I suppress this dialog programmatically using chromedriver's options?  (Something equivalent to FireFox's <code>pdfjs.disable</code> option in <code>about:config</code>).</p>
  
  <p>Here is my current attempt to bypass the dialog, which does not work (by "not work" does not disable or suppress the print pdf dialog window):</p>
  
  <pre><code>    dc = DesiredCapabilities.CHROME
      dc['loggingPrefs'] = {'browser': 'ALL'}
  
      chrome_profile = webdriver.ChromeOptions()
      profile = {"download.default_directory": "C:\\SeleniumTests\\PDF",
                 "download.prompt_for_download": False,
                 "download.directory_upgrade": True}
      chrome_profile.add_experimental_option("prefs", profile)
      chrome_profile.add_argument("--disable-extensions")
      chrome_profile.add_argument("--disable-print-preview")
  
      self.driver = webdriver.Chrome(executable_path="C:\\SeleniumTests\\chromedriver.exe",
                                         chrome_options=chrome_profile,
                                         service_args=["--log-path=C:\\SeleniumTests\\chromedriver.log"],
                                         desired_capabilities=dc)
  </code></pre>
  
  <p>All component versions are the same in both testing environments:</p>
  
  <p>Selenium 2.43.0, Python 2.7.5, Chromedriver 2.12, Chrome (browser) 38.0.02125.122</p>