Reputation: 61
I am a part of Automation testing and I am downloading and installing the files programmatically with Selenium and Applescript on Mac. Is their any way to check the location of download folder on browsers programmatically?? if so pls suggest and also ways to change the location of download folder in Java or Applescript.
Upvotes: 0
Views: 993
Reputation: 377
may be you can try like this on firefox:
profile = Selenium::WebDriver::Firefox::Profile.new
profile['browser.download.dir'] = "/tmp/webdriver-downloads"
profile['browser.download.folderList'] = 2
profile['browser.helperApps.neverAsk.saveToDisk'] = "application/pdf"
b = Watir::Browser.new :firefox, :profile => profile
Upvotes: 1
Reputation: 27613
Safari has a preference for it in ~/Library/Preferences/com.apple.Safari.plist:
defaults read com.apple.Safari DownloadsPath
You can also change it by modifying the property list, but the changes aren't applied until Safari is reopened.
defaults write com.apple.Safari DownloadsPath "~/Desktop"
Upvotes: 0