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.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
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 [email protected].
For more options, visit https://groups.google.com/d/optout.