Set firefox profile from pre-existing browser profile or set extension protractor
I have 2 ways set firefox profile:
var makeFirefoxProfile = function (preferenceMap) { var profile = new firefox.Profile("./ozbzfc4i.automation"); for (var key in preferenceMap) { profile.setPreference(key, preferenceMap[key]); }
return q.resolve({ browserName: 'firefox', marionette: true, firefox_profile: profile }); };
and code load web extension:
var makeFirefoxProfile = function (preferenceMap) { var profile = new firefox.Profile(); for (var key in preferenceMap) { profile.setPreference(key, preferenceMap[key]); } profile.addExtension('./firebug.xpi');
return q.resolve({ browserName: 'firefox', marionette: true, firefox_profile: profile }); }; But it cannot set profile and browser opens multiple tabs when run, not single tab. I follow this article: http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/firefox/index.html I don't know how wrong???
What do you mean it opens multiple tabs not single tab? From your issue here (https://github.com/saadtazi/firefox-profile-js/issues/82) you were using firefox-profile-js before, since you no longer use it you don't get the default firefox preferences from it (https://github.com/saadtazi/firefox-profile-js/blob/master/lib/firefox_profile.js#L25)
If you want it to open multiple windows instead of multiple tabs you need to set this https://github.com/saadtazi/firefox-profile-js/blob/master/lib/firefox_profile.js#L32. Default for geckodriver is 3 which opens external links in new tabs
Hi lmtierney,
I'm using require('selenium-webdriver/firefox').Profile;, not firefox-profile package.
The problem here is filefox cannot load profile from pre-existing browser profile.
If I declare var profile = new firefox.Profile(); it works ok.
If I declare var profile = new firefox.Profile("./ozbzfc4i.automation"); I could not find profile ozbzfc4i.automation loaded.
I want to set firefox profile from pre-existing browser profile with param ./ozbzfc4i.automation
Thanks
I understand what you're doing. How do you know it isn't using the profile?
I installed extension, edit config, whatever,... when protractor load firefox profile ./ozbzfc4i.automation, I want to see things I did earlier are shown, example: extensions I install are loaded Thanks :)
Is it giving you an error? What do you see if you put a breakpoint in and check the about:config page within Firefox, do you see your preferences as you set them?
It is still running normally, no error, but I cannot see extension I installed and path download file I set earlier. When I add profile.addExtension('./firebug.xpi'); not use pre-existing browser profile, It also show the same case. Thanks
Are you sure it's not loaded? I just tried it with firebug and it's loaded but is disabled.
Make sure you use the root directory of the profile you pass it and not the local directory
Hi, can you help me reprodurce at my repo in 2 ways. I want to try set firefox profile from pre-existing browser profile because load extension is disabled. Thanks.
Attach image: http://www.upsieutoc.com/image/YcERRQ
Hi lmtierney, What is the root directory of the profile???
C:\Users\...\AppData\Roaming\Mozilla\Firefox\Profiles\avbq6r8s.TamVo
or C:\Windows, or whatever folder contains profile,....
Thanks
Go to about:profiles in the browser and copy the path for the Root Directory
Hi lmtierney,
I set profile var firefoxProfile = new FirefoxProfile("C:/Users/.../AppData/Roaming/Mozilla/Firefox/Profiles/avbq6r8s.TamVo");
But i have an error:
WebDriverError: java.io.FileNotFoundException: C:\Users\...\AppData\Local\Temp\webdriver3207885029359577597duplicated\C:\Users\...\AppData\Local\Temp\tmp-12720YNCuK
ZQFwPPR\addons.json (The filename, directory name, or volume label syntax is incorrect)
When I add directConnect: true it run ok, but not set profile. The problem in here is directConnect cannot set firefox profile? Thanks.
FirefoxProfile("C:/Users/.../AppData/Roaming/Mozilla/Firefox/Profiles/avbq6r8s.T") does not match your C:\Users\...\AppData\Roaming\Mozilla\Firefox\Profiles\avbq6r8s.TamVo that you said earlier
Sorry, I edited last comment FirefoxProfile("C:/Users/.../AppData/Roaming/Mozilla/Firefox/Profiles/avbq6r8s.TamVo"), but issue still occur
Attach root directory image: http://www.upsieutoc.com/image/Y2emkL
Error image: http://www.upsieutoc.com/image/Y2PfOq
We need a way to reproduce this issue without protractor, using pure official selenium client library.
It sounds like you are expecting webdriver changes to impact the preexisting profile. This is not the case - when you specify an existing profile it is copied to a new profile, so any changes made with webdriver will not impact the original. On Fri, Aug 4, 2017 at 7:38 AM Alexei Barantsev [email protected] wrote:
We need a way to reproduce this issue without protractor, using pure official selenium client library.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SeleniumHQ/selenium/issues/3500#issuecomment-320266177, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPkCcE9KgGwJPF0NXAfqe1LNDsekj15ks5sUyz5gaJpZM4L_ZdH .
Closing the issue, there is no reporoduction scenario provided.