Yeah, I don't think profiles are working ideally in Firefox right now, I'm 
still investigating some of that right now.

You want to pass this in as a `prefs` value:

Not asking should be default?

So I think it should be this:
Watir::Browser.new(:firefox, options: {prefs: 
{"browser.download.folderList" => "/path/to/downloads"}})

All the pref options should be here:
http://kb.mozillazine.org/About:config_entries



On Saturday, December 29, 2018 at 4:59:37 AM UTC-8, rajagopal...@gmail.com 
wrote:
>
> I have succeeded to set the download folder for chrome and it's perfectly 
> doing it's Job, but I couldn't do it for firefox
>
> I have written the following code for chrome
>
> client = Selenium::WebDriver::Remote::Http::Default.new
> client.read_timeout = @Page_Load # seconds
> prefs = {
>  download: {
>  prompt_for_download: false,
>  default_directory: File.expand_path("../../../AppData/Downloads", __FILE__)
>  }
> }
> @b = Watir::Browser.new :chrome, http_client: client, args: 
> ['user-data-dir=C:\Rajagopalan'], options: {prefs: prefs}
>
> It works perfectly but when I try to set same for firefox by the following 
> code
>
> puts 'Test Starts in Latest Firefox'
> profile = 
> Selenium::WebDriver::Firefox::Profile.new('C:\Users\rajagopalan.m\AppData\Roaming\Mozilla\Firefox\Profiles\5yit4mlq.default')
> profile['browser.download.dir'] = 
> File.expand_path("../../../AppData/Downloads", __FILE__)
> profile['browser.helperApps.neverAsk.saveToDisk'] = 'raj'
> options = Selenium::WebDriver::Firefox::Options.new
> options.profile = profile
>
> client = Selenium::WebDriver::Remote::Http::Default.new
> client.read_timeout = @Page_Load
> @b = Watir::Browser.new :firefox, http_client: client, options: options
>
> It's not working as it's working for Chrome. Can someone help me? 
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
In short: search before you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to