Firefox profiles for Selenium automation

20 Apr

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?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Der Flounder

Seldom updated, occasionally insightful.

The 4T - Trail, Tram, Trolley, Train

Exploring Portland with the 4T

Midnight Musings

Thoughts on making art

Automation Guide

The More You Learn The More You Play...!

The Performance Engineer

Code.Test.Tune.Optimize.

humblesoftwaredev

Thoughts related to software development

Yi Wang's Tech Notes

A blog ported from http://cxwangyi.blogspot.com

Appium Tutorial

Technical…..Practical…..Theoretically Interesting

LinuxMeerkat

I swear! Meerkats can do Linux

PacketsDropped

Requeuing the packets dropped in my memory.

Two cents of software value

Writing. Training. Consulting.

@akumar overflow

wisdom exceeding 140 chars.

Lazy Programmer's Shortcut

Java, J2EE, Spring, OOAD, DDD & LIFE! .......all in one :)

Testing Mobile Apps

www.SoftwareTestingStudio.com

Photofocus

education and inspiration for visual storytellers

No, Seriously...

Freeing up some mind cache!

Mike Taulty

I do some developer stuff for Microsoft UK

%d bloggers like this: