Using Existing Firefox Profile In Selenium 2 - Not Working? Bug?

Apart from reading all the posts about this on stackoverflow and many others, I've tried every idea people give, but I can't seem to get it done.

Presumably 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

a few other ideas don't work either (at least for me).

Debugging my code and looking at each item, I realized that actually "my_profile" is in the "allProfiles" collection, but when I try to get it, it doesn't work; it accepts a "default profile" and not the one I want.

It's some kind of mistake? Is it possible to use a pre-existing profile?


-> My mistake: it didn't work, apparently because of the profile name; having nothing else, I changed it so that now it only has alphanumeric characters and now it works. Since I solved this, I don't need the answers anymore, but I will not delete the question because it might help someone else.

+3


source to share


1 answer


This does not work, apparently because of the profile name; having nothing else, I changed it so that now it only has alphanumeric characters and now it works. Since I solved this, I don't need the answers anymore, but I will not delete the question because it might help someone else.



+3


source







All Articles