Firefox 4 with watir webdriver: Need help using helperApps.neverAsk to save CSV without prompting?

I've done some testing of this for you, unfortunately there doesn't seem to be a standard content-type for CSV files. You can try passing a comma separated list of content-types, hopefully one of those work for you. For me it was application/octet-stream that did the trick require 'watir-webdriver' require 'selenium-webdriver' profile = Selenium::WebDriver::Firefox::Profile.

New profile"browser.download. UseDownloadDir" = true profile"browser.download. Dir" = '/tmp' profile"browser.helperApps.neverAsk.

SaveToDisk" = "text/plain, application/vnd. Ms-excel, text/csv, text/comma-separated-values, application/octet-stream" driver = Selenium::WebDriver. For :firefox, :profile => profile browser = Watir::Browser.

New(driver) browser. Goto "http://altentee.com/test/test.csv.

I've done some testing of this for you, unfortunately there doesn't seem to be a standard content-type for CSV files. You can try passing a comma separated list of content-types, hopefully one of those work for you. For me it was application/octet-stream that did the trick... require 'watir-webdriver' require 'selenium-webdriver' profile = Selenium::WebDriver::Firefox::Profile.

New profile"browser.download. UseDownloadDir" = true profile"browser.download. Dir" = '/tmp' profile"browser.helperApps.neverAsk.

SaveToDisk" = "text/plain, application/vnd. Ms-excel, text/csv, text/comma-separated-values, application/octet-stream" driver = Selenium::WebDriver. For :firefox, :profile => profile browser = Watir::Browser.

New(driver) browser. Goto "http://altentee.com/test/test.csv.

One of them worked, I don't know which one. But I will leave them all just in case something changes. – carlo.

Borreo Apr 11 at 9:21 it doesn't hurt to have multiple content-types, given there's no one standard. Glad it's working for you ... – Tim Koopmans Apr 12 at 1:12 It's "text/csv" that is needed – Alister Scott Aug 15 at 0:19.

In Firefox 6+, I couldn't get this to work without specifically setting the 'browser.download. FolderList' value: profile = Selenium::WebDriver::Firefox::Profile. New profile'browser.download.

FolderList' = 2 #custom location profile'browser.download. Dir' = download_directory profile'browser.helperApps.neverAsk. SaveToDisk' = "text/csv, application/csv" be = Watir::Browser.

New :firefox, :profile => profile See: http://watirwebdriver.com/browser-downloads.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions