The problem is that you cannot manipulate this βSave As ...β dialog through protractor / selenium. You should avoid opening it in the first place and let firefox automatically download files of a certain type of mime type - in your case application/zip .
In other words, you need to start Firefox using a Firefox profile that sets the appropriate settings :
var q = require("q"); var FirefoxProfile = require("firefox-profile"); var makeFirefoxProfile = function(preferenceMap, specs) { var deferred = q.defer(); var firefoxProfile = new FirefoxProfile(); for (var key in preferenceMap) { firefoxProfile.setPreference(key, preferenceMap[key]); } firefoxProfile.encoded(function (encodedProfile) { var capabilities = { browserName: "firefox", firefox_profile: encodedProfile, specs: specs }; deferred.resolve(capabilities); }); return deferred.promise; }; exports.config = { getMultiCapabilities: function() { return q.all([ makeFirefoxProfile( { "browser.download.folderList": 2, "browser.download.dir": "/path/to/save/downloads", "browser.helperApps.neverAsk.saveToDisk": "application/zip" }, ["specs/*.spec.js"] ) ]); },
Here we mainly say: Firefox, download zip files automatically without asking in the /path/to/save/downloads directory.
source share