I am using following code to download CSV file and its working properly on MAC but on Windows its not working.
On window it download file but it save it in download folder i.e. default path
def self.launch(browser=:firefox, profile=nil)
profile = Selenium::WebDriver::Firefox::Profile.new
path = File.join(File.join(Dir.pwd), 'csv_files')
FileUtils.rm_rf(path) if Dir.exists? path
Dir.mkdir(path)
profile['browser.download.dir'] = path
profile['browser.download.folderList'] = 2
profile['browser.helperApps.neverAsk.saveToDisk'] = 'text/csv'
profile['pdfjs.disabled'] = true
$watir_browser = UITest.new_browser_session browser, profile
$driver = $watir_browser.wd
return $watir_browser
end
Please suggest me if any changes are required.