Firefox profile setting throws error in protractor with selenium web server configuration
var q = require("q");
var FirefoxProfile = require("firefox-profile");
var makeFirefoxProfile = function(preferenceMap) {
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",
directConnect: true,
firefox_profile: encodedProfile
};
deferred.resolve(capabilities);
});
return deferred.promise;
};
exports.config = {
specs:specs,
getMultiCapabilities: function() {
return q.all([
makeFirefoxProfile(
{
"browser.download.folderList": 2,
"browser.download.dir": "/path/to/save/downloads",
"browser.helperApps.neverAsk.saveToDisk": "application/zip"
}
)
]);
},
// ...
}
It throws the following error:
ERROR - Could not load config file protractor.conf.js / usr / local / lib / node_modules / protractor / lib / configParser.js: 183 throw e; ^ Error: Cannot find module 'q'
Please share your views to resolve this issue.
+3
source to share