Most automation testers probably know how to work with Firefox profiles for Selenium automation. But thought I’d point out some tips and bring up a discussion question.
This is a good article for how to create a Firefox profile for automation (or even other purposes): http://girliemangalo.wordpress.com/2009/02/05/creating-firefox-profile-for-your-selenium-rc-tests/
And here’s a tip on how to best use Firefox profiles on Selenium 2 / WebDriver particularly if you are migrating or migrated from Selenium RC, to rather not start over from scratch building the profile the new way (from code):
use code to load an existing profile (directory), a sample in Java is presented
FirefoxProfile profile = new FirefoxProfile(new File(“C:\\PathTo\\CustomProfileDirectory”));
driver = new FirefoxDriver(profile);
And now a discussion question based on the profile creation method descripted in the referenced link/post:
What I’ve noticed, at least for FF 3.6 profile manager is that there is no option to import and export an existing FF profile. So you can only create new ones and edit existing ones on your FF installation (i.e. existing profiles you’ve set up on the machine).
As a hack, to do an import, I’ve create a dummy profile with the manager, then open FF with it, and exit FF. Then replace/overwrite content in that profile (directory) with the desired profile to import. Then open FF again with that modified profile and make any additional changes as needed, then exit. Then can manually copy back that profile folder elsewhere as export step. This method allows you to update a FF profile created on another machine.
Is there any better method to do an import/export other than my hack? Or use newer version of FF?