title: Why is Firefox not using the profile preferences via selenium?
body: <p>I am trying to download a PDF files using Firefox in Selenium but the preferences I have set below do not seem to be working. Whenever I run the code, I am still getting the <code>"You have chosen to open:"</code> dialog box even though the preferences state that PDF files should automatically be downloaded.</p>
  
  <p>Am I missing something?</p>
  
  <pre><code>def setUp(self):
      downloads_folder = initialSearch.download_path(self)
  
      profile = webdriver.FirefoxProfile()
      profile.set_preference("browser.download.manager.showWhenStarting", False)
      profile.set_preference("browser.download.folderList", 2)
      profile.set_preference("browser.download.dir", downloads_folder)
      profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/pdf")
      self.driver = webdriver.Firefox(profile)
  </code></pre>