public
Created

Tweaking Firefox preference to automatically download files to custom location

  • Download Gist
automation_spec_helper.rb
Ruby
1 2 3 4 5 6 7 8
Capybara.register_driver :selenium do |app|
profile = Selenium::WebDriver::Firefox::Profile.new
profile['browser.download.dir'] = "#{Rails.root}/tmp/webdriver-downloads"
profile['browser.download.folderList'] = 2 # implies custom location
profile['browser.helperApps.neverAsk.saveToDisk'] = "text/csv,application/pdf"
Capybara::Selenium::Driver.new(app, :browser => :firefox ,:profile => profile)
#...
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.