To alter the profile's choices in Firefox, create a new FirefoxProfile object and update the profile's preferences. More preferences can be found in the MozillaZine Knowledge Base. A modified Firefox Profile is used in this example to disable Flash and accept the French language in Firefox.
To start the Create Profile Wizard, click Create Profile... in the Profile Manager.
After that, click Next and give the profile a name.
If you want to pick where to save the profile on your computer, ignore the Choose Folder option.
Click Finish to finish creating the new profile.
When you run Firefox, you can use either -P "profile name" or -profile "profile path." This is accomplished by attaching the command line option to the end of the target value of your Firefox desktop shortcut.
Download geckodriver.exe from GeckoDriver Github Release Page. ...
Set the System Property for “webdriver.gecko.driver” with the geckodriver.exe path – System.setProperty(“webdriver.gecko.driver”,”geckodriver.exe path”);
There are many benefits of using a Firefox profile in Selenium. A Firefox profile can be used as a reference for how to set up the tests, which makes them easier to maintain over time. It also allows you to use different profiles for different browsers at the same time.