Calling the method you specified simply creates a java profile object from the specified directory of profile information, which is then passed to Firefox through an instance of WebDriver.
In order for Firefox to save your driver and make it accessible from the profile manager, you need to edit the profiles.ini file on my machine (Windows 7), it was in:
% APPDATA% \ Roaming \ Mozilla \ Firefox
The profiles directory in this folder contains repositories of existing Firefox profiles, which are very convenient for copying when you want to use an existing profile as a template for a new one.
Your mileage may vary depending on your OS, but I'm sure you can find it with a quick search. Using your example, you should add the following to this file (where N in the header is the next unused profile number):
[ProfileN] Name=selenium IsRelative=0 Path=D:\Selenium
This will force the Firefox Profile Manager to load the profile and allow you to start Firefox manually with this profile in order to configure or test it, which I suppose you want to do.
Once you create a named profile this way, you can assign it to your Selenium driver as follows:
ProfilesIni allProfiles = new ProfilesIni(); FirefoxProfile profile = allProfiles.getProfile("selenium"); WebDriver driver = FirefoxDriver(profile);
Where "selenium" matches the property name in the profiles.ini file.
source share