What is Profile
Firefox saves your personal information such as bookmarks, passwords, and user preferences in a set of files called your profile, which is stored in a separate location from the Firefox program files.
You can have multiple Firefox profiles, each containing a separate set of user information. The Profile Manager allows you to create, remove, rename, and switch profiles.
Some times, we may need to update the preferences within Firefox. We can do this by instantiating a Firefox Profile object and then update the settings.
We will then need to pass this object into FirefoxDriver which will load the profile with your defined settings.
We can check them using command "about:config" in the borwser. It will display a warning message and then asks you to proceed if required.
Steps for creating a profile:
FirefoxProfile profile= new FirefoxProfile();
Setting homepage:
profile.setPreference("browser.startup.homepage","http://www.google.com");
Setting up specified download location/folder
profile.set_preference("browser.download.folderList", 2)
profile.set_preference("browser.download.manager.showWhenStarting", False)
profile.set_preference("browser.download.dir", 'PATH TO DESKTOP')
profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/x-gzip")
driver = new FirefoxDriver(profile);
Firefox saves your personal information such as bookmarks, passwords, and user preferences in a set of files called your profile, which is stored in a separate location from the Firefox program files.
You can have multiple Firefox profiles, each containing a separate set of user information. The Profile Manager allows you to create, remove, rename, and switch profiles.
Some times, we may need to update the preferences within Firefox. We can do this by instantiating a Firefox Profile object and then update the settings.
We will then need to pass this object into FirefoxDriver which will load the profile with your defined settings.
We can check them using command "about:config" in the borwser. It will display a warning message and then asks you to proceed if required.
Steps for creating a profile:
FirefoxProfile profile= new FirefoxProfile();
Setting homepage:
profile.setPreference("browser.startup.homepage","http://www.google.com");
Setting up specified download location/folder
profile.set_preference("browser.download.folderList", 2)
profile.set_preference("browser.download.manager.showWhenStarting", False)
profile.set_preference("browser.download.dir", 'PATH TO DESKTOP')
profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/x-gzip")
driver = new FirefoxDriver(profile);