Firefox Profile in Selenium WebDriver: Welcome to another new post of the Selenium WebDriver tutorial series, where we will discuss the Firefox Profile. Firefox Profile stores the settings, add-ons, customization, and other personalization settings, which are done explicitly for the Firefox browser. With this feature, we can set it as per our automation requirement.
Why do we Need a New profile?
Every browser has a default Firefox profile, but that is not automation-friendly, so when you want to run your automation script in a reliable model, it’s advisable to run an automation script in a separate Firefox profile.
How to Find Your Profile?
You can locate your profile on a local PC depending on your operating system; here below, we have shared the location according to the OS
Operating System | Profile Folder Path |
---|---|
Windows XP / 2000 / Vista / 7 | %AppData%MozillaFirefoxProfilesxxxxxxxx.default |
Linux | ~/.mozilla/firefox/xxxxxxxx.default/ |
Mac OS X | ~/Library/Application/Support/Firefox/Profiles/xxxxxxxx.default/ |
How to Create a Firefox Profile?
Creating a new Firefox profile and using that in your automation script needs three steps process, Which is
- Start the Profile Manager
- Create a new profile
- Use the Created Profile in Selenium Script
Start the Profile Manager
- If there is any open Firefox browser, then close that.
- Open the Run prompt by pressing (Windows + r) or Press the windows, then choose and run.
- Type “firefox.exe -p'” and click ok.
After clicking ok, you may get another new window name, profile manager. If you can’t see, then sometimes it’s running in the background. So it would be best if you closed properly, or you can use CTRL+ALT+DEL to close completely. If it still does not open, then you need to specify the path of the Firefox program.
On 32-bit: Windows: “C:\Program Files\Mozilla Firefox.exe” –p
On 64-bit: Windows: “C:\Program Files(x86)\Mozilla Firefox.exe” –p