Closed tamvo94 closed 7 years ago
Hi @tamvo94 , I saw that you posted on stackoverflow. I also found this issue on protractor repo...
I feel like there is a mix of firefoxProfile from selenium-webdriver
package and from firefox-profile
package (this repo)... Which are 2 different ways to generate firefox profile.
I am not really familiar with latest versions of protractor andhow it handles firefox profiles... Do you have a repo with the minimal setup that reproduces the issue?
Thank you,
Saad
Hi, please see my repo: https://github.com/tamvo94/config-firefox You can reprodure it. Error in firefox_profile: encodedProfile Can you help me fix it? Thanks :)
If you only pass user prefs, then you should not need firefox-profile
: see this
I need to set download files path in FF, so I set firefox profile to do it. So can I remove firefox-profile that I can set "browser.download.dir"???? Thanks.
So this is how you should fix it:
var FirefoxProfile = require("selenium-webdriver/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",
// marionette: true,
// firefox_profile: encodedProfile
// };
//
// deferred.resolve(capabilities);
// });
// return deferred.promise;
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 can see the settings in about:config
page).
Why: now selenium-webdriver
expects a selenium-webdriver/firefox
Profile
instance when a firefox_profile
is provided. In the past, it was expecting a base64 encoded firefox profile. THey probably changed that when they introduced the ability to create firefox profiles in selenium-webdriver
.
Note that this has nothing to do firefox-profile
. You don't need firefox-profile
now that selenium-webdriver introduced firefox.Profile
Thank you for your support <3. I can use firefox profile to set anything. You can close this issue if you have anything else
Hi, I add extension for this firefox profile, but the seem, firefox cannot install it and cannot setPreference both.
var firefoxExtension = "./extension/firefox_integration/sample.xpi";
firefoxProfile.addExtension(firefoxExtension);
return q.resolve({
browserName: 'firefox',
marionette: true,
firefox_profile: firefoxProfile
});
I also set available profile but it cannot work.
var firefoxProfile = new FirefoxProfile("C:/Users/.../AppData/Roaming/Mozilla/Firefox/Profiles/avbq6r8s.TamVo");
I did not know how wrong???
@tamvo94, like I mentioned, you no longer need firefox-profile
package in your project. Now, you have to refer to selenium-webdriver
documentation (and the firefox/profile
class...).
I am not sure how firefox extension works with selenium-webdriver
profiles
...
The selenium-webdriver
documentation shows that the Profile constructor seems to accept an opt_str
params, which is a Path to an existing Firefox profile directory to use a template for this profile. If not specified, a blank profile will be used
... But you'll have to ask your questions to the selenium-webdriver
folks using those resources (found here):
- the #selenium channel on freenode IRC
- the selenium-users@googlegroups.com list
Good luck
I try to use this code with directConnect: true:
But it show error when start server:
I have wonder that profile = caps.get(Capability.PROFILE) return string, and getTemplateDir() {return this.template_;} is function in class Profile at node_modules\protractor\node_modules\selenium-webdriver\firefox\index.js I don't know how to fix it. More info: