I have the following code snippet. I want pdf files to be automatically saved to the directory.
profile = Selenium::WebDriver::Firefox::Profile.new
profile['browser.download.dir'] = "//Users/mmuenster/www/pc_interface/pdf_downloads"
profile['browser.download.folderList'] = 2
profile['browser.helperApps.neverAsk.saveToDisk'] = 'application/pdf'
driver = Selenium::WebDriver.for :firefox, :profile => profile
driver.manage.window.maximize
However, though the "about:config" in Firefox shows this option being set, when I got to preferences and applications in Firefox, pdfs are set to "Preview in Firefox".
Any ideas what is wrong?
Thanks
I discovered the problem. I upgraded to Firefox 19 which has the pdfjs add-on built in. The solution was to add the following
profile['pdfjs.disabled'] = true
This worked!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With