Created
August 25, 2012 16:35
-
-
Save karthiks/3467654 to your computer and use it in GitHub Desktop.
Tweaking Firefox preference to automatically download files to custom location
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment