4

Besides having read all the posts about it in stackoverflow and many others, I have tried every idea people give, but I can't do it work.

Supposedly I should have Selenium 2 / Webdriver working with the profile I want in Firefox with these lines:

ProfilesIni allProfiles = new ProfilesIni(); FirefoxProfile profile = allProfiles.getProfile("My_Profile"); driver = new FirefoxDriver(profile); 

OR

FirefoxProfile profile = new ProfilesIni().getProfile("path_to_profile"); driver = new FirefoxDriver(profile); 

OR

several other ideas doesn't work either (at least for me).

Debugging my code and watching every element, I have realized that in fact, "my_profile" is into "allProfiles" collection, but when I try to get it, it doesn't work; it takes a "default-profile", not the one I want.

Is this some kind of bug? Is it possible to use a pre-existing profile?


--> My fault: It didn't work apparently because of the name of the profile; having nothing else to try, I've changed it so now it has just alphanumeric characters and now it works. Since I have solved it, I don't need more answers, but I wont delete the question because it could help someone else.

1
  • I have experimented with this and personally I prefer using a default instance of Firefox without loading a explicit profile. I only have to open the browser once though and I reuse the browser window throughout my tests and so I don't have a performance impact. Commented Feb 16, 2013 at 16:55

1 Answer 1

3

It didn't work apparently because of the name of the profile; having nothing else to try, I've changed it so now it has just alphanumeric characters and now it works. Since I have solved it, I don't need more answers, but I wont delete the question because it could help someone else.

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer has indeed solved my problem regarding associating custom FF profile. It would be helpful if you can help me solve the final piece of my puzzle by telling me how to attach the profile kept in a custom location. I want the tests to run on any machine with a FF, so I want to configure my custom profile with it.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.