Set firefox profile protractor

前提是你 提交于 2019-12-01 01:58:40

it seems like selenium-webdriver (which is used by protractor) used to accept a base64 encoded string firefox_profile capability property. But now it expects a selenium-webdriver/firefox.Profile instance. So here is how you can solve your issue:

// make sure you have access to the selenium-webdriver firefox Profile class
var FirefoxProfile = require("selenium-webdriver/firefox").Profile;
//... 
// then change makeFirefoxProfile() function implementation with the following...

var makeFirefoxProfile = function (preferenceMap) {
  var profile = new FirefoxProfile();
  for (var key in preferenceMap) {
    profile.setPreference(key, preferenceMap[key]);
  }
  return q.resolve({
    browserName: "firefox",
    marionette: true,
    firefox_profile: profile
  });
};

I hope this helps.

Note that firefox-profile package is no longer needed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!