我尝试使用此代码:
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",
firefox_profile: encodedProfile
};
deferred.resolve(capabilities);
});
return deferred.promise;
};
getMultiCapabilities: function () {
return q.all([
makeFirefoxProfile(
{
"browser.download.folderList": 2,
"browser.download.dir": "D:/Automation",
"browser.helperApps.alwaysAsk.force": false
}
)
]);
},
但它显示错误: 错误:TypeError:profile.getTemplateDir is not a function 我不知道如何修复它。