Firefox profiles

We know everytime webdriver opens firefox it opens a new profile of its own .

It does not open the firefox we open on daily basis that includes all our history and bookmarks etc.

Let us suppose we want firefox to open the profile we want.

For that first we have to make a firefox profile.

For that click windows +r and in that type firefox.exe –P

and then click create new profile and give it a name like Myfirefox and then when that profile opens in firefox and open any website and make its bookmark.

Then we go to Eclipse and type the following code.

public void profFnc(){
ProfilesIni allprof = new ProfilesIni();
FirefoxProfile prof = allprof.getProfile("MyProfile");
FirefoxOptions options =  new FirefoxOptions();    
options.setProfile(prof);
System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE,"none");
FirefoxDriver driver =  new FirefoxDriver(options);
drive1.get("http://yahoo.com");

Then we can also turn off notifications in firefox in the profile we created using the below command

prof.setPreference("dom.webnotifcations.enable",false);