Selenium2Library and Firefox options

316 views
Skip to first unread message

Gilles Lenfant

unread,
Aug 6, 2014, 4:40:34 PM8/6/14
to robotframe...@googlegroups.com
Hi,

I'm trying to change some Firefox options, like the user prefered language through the "Open Browser" or "Create Webdriver" kw.
More precisely, I'm trying to do the equivalent of changing an option in the "about:config" table.

Any hint is welcome
--
Gilles Lenfant

Ed Manlove

unread,
Aug 6, 2014, 8:59:48 PM8/6/14
to gilles....@alterway.fr, robotframe...@googlegroups.com
> --

Gilles,

You could possible use a profile setting and the use that custom profile
with the Open Browser keyword

Open Browser http://robotframework.org Firefox
C:/Path/To/FF/Profile/Directory

You can create a new profile using instructions for Mozilla's site
[https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles]
and the strip all but the pref.js and permissions.sqlite files [and it
might be only the prefs.js file required - been a while since i tired].
To find which setting to change there I tried a search on "user
preferred language firefox prefs.js" and came up with some not so quite
useful references [1, 2(old), 3] and also searched my pref.js not
finding it. You might try changing the setting and then opening your
pref.js file to see what to change. But using a custom firefox profile
might work for you.

Ed

[1]
https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/A_brief_guide_to_Mozilla_preferences#files
[2] http://kb.mozillazine.org/About:config_entries
[3]
https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/Preference_reference

Gilles Lenfant

unread,
Aug 7, 2014, 9:57:29 AM8/7/14
to robotframe...@googlegroups.com, gilles....@alterway.fr


Many thanks Ed,

This is almost what I needed. It seems that RF or Selenium creates a temporary profile dir (didn't find where) that's initialized with json data that are hardcoded somewhere in the packages and cannot be overrided (easily ?) from RF.
This gives me an easy solution to have a browser that asks for english content first.
Gonna hack Splinter ( http://splinter.cobrateam.info/ ) that has enables to change "about:config" items with a Python dict. And publish the solution here if easy to publish. I need to change per test session settings, like the download directory.
Reply all
Reply to author
Forward
0 new messages