title: Change Firefox default download settings within Selenium
body: <p>I'm in the deep end in which I'm learning to use Cucumber with Selenium Webdriver in Ruby on the job.  Totally new to it.</p>
  
  <p>I have a test in which I need to test a CSV file download is working.  At the moment in Firefox, a pop up appears and Selenium has trouble focusing on that and the test fails.  I'd like to change the default settings of Firefox within Selenium so that the download will automatically go to the downloads folder and skip the pop up box stage completely.</p>
  
  <p>I have seen a few answers:</p>
  
  <pre><code>profile = Selenium::WebDriver::Firefox::Profile.new
  profile["browser.download.folderList"] = 1 # use the custom folder defined in "browser.download.dir" below
  profile["browser.download.dir"] = 'C:\Users\OSAT TESTING\Downloads'
  profile["browser.helperApps.neverAsk.saveToDisk"] = 'application/csv'
  </code></pre>
  
  <p>Yet there's no explanation as to where to place this code.  Is it within the code to test the step, or the env.rb file etc?</p>
  
  <p>Help, please this is giving me such a headache!!</p>
  
  <p>Thanks</p>