0
votes

I am using ruby and selenium to automate my tests, i have this code to set the profile for firefox

  profile = Selenium::WebDriver::Firefox::Profile.new
  profile['browser.download.dir'] = "C:\\new"
  profile['browser.download.folderList'] = 2
  profile['browser.helperApps.neverAsk.saveToDisk'] = ' application/octet-stream'
  @browser = Selenium::WebDriver.for :firefox, :profile => profile

when the downloading takes place it does download automatically, however it downloads into the defualt "downloads" area, so the setting of browser.download.dir isnt working

The profile is being loaded in correctly though, if pause the test and go into the about:config on the webdriver I can see that the profile has loaded in correctly, but it still downloads into download

I am guessing i maybe missing another setting but from looking around the internet the above code seems to work for most people

1

1 Answers

0
votes

the issue seemed to be with the string being passed in, possible character escaping issues ,the following worked

      profile['browser.download.dir'] = 'C:\\\new'