While installing Firefox, it creates a default profile folder in your local drive that saves info like bookmarks, passwords, user preferences, and some other settings. You can have multiple Firefox profiles, each containing a separate set of user information. Let's say there are two users who are using the same computer, and both want their own Firefox settings then both users can create & access their own Firefox profile whenever they open the Firefox browser.
When Firefox is launched with Selenium WebDriver, certain plug-ins, extensions, bookmarks, etc. are not available. It opens a blank Firefox browser. Sometimes we need these plug-ins, extensions, etc. while executing the selenium test case.
To enable the usage of these different bookmarks, have separate extensions, plug-ins, etc. Firefox's profiles system comes in handy. Multiple profiles can be created on a system, each profile having its own bookmarks, settings, add-ons, browser history, cookies, and other data.
What is the need of creating a custom Firefox profile?
- Many times, we require some special settings in the Firefox profile just to make test execution more reliable. The most common example is an SSL certificate settings or browser plug-ins that handle self-signed certificates. For these kinds of requirements during test execution, we need to create a custom profile that can easily handle this requirement & make test execution more reliable.
- Every time if you use different profiles, the SSL certificates you accepted or the plug-ins you installed would be different and that would make the tests behave differently on the machines.
- Always make sure that the profile you have created must be very lightweight that only includes those plug-ins, extensions, and settings that are required in test execution. Whenever selenium starts, a new session is created for Firefox instance that copies the entire profile in some temporary directory and if the profile is big, it makes it slow & unreliable.
Mozilla Firefox now allows you to manage profiles while it’s running, without the need for using the Profile Manager found in older versions. To access this feature, type “about:profiles” in Firefox’s address bar, and then press Enter. You can bookmark this page for easier access in the future if you like.
If you haven’t fiddled with Firefox profiles before, you will likely be using the “default” profile.
ROOT DIRECTORY: The one in roaming is the main profile folder. Firefox stores its information here, so you could even have the same bookmarks between computers with a roaming profile.
Note: The Root Directory must be used for performing your tests using Leapwork.
LOCAL DIRECTORY: The profile in local is just used for storing the cache. It is the folder that is specific to that computer - any information here would not be synchronized.
How to create a new profile in firefox
To create a new profile, click the “Create a New Profile” button.
Click through the “Create Profile Wizard” window that appears and provide a descriptive name for the new profile, so you can remember what it’s for. For example, you might name it “Selenium Test” if it’s for some selenium tests.
To relaunch Firefox with your new profile, first, click the “Set as default profile” button under the profile here. Once it’s your default profile, close all open Firefox browser windows and then relaunch Firefox. It launches with the default profile you chose.
To switch back to another profile, head to about:profiles once again, click “Set as default profile” for the profile you want to use, and then close and relaunch Firefox.
If you don’t need a profile anymore, you can click the “Remove” button here to remove it from your system. Bear in mind that this will delete all the data saved with the profile, including its bookmarks, saved passwords, and add-ons.
How to Use the Old Profile Manager Instead
You can also do everything we’ve talked about with the older Firefox Profile Manager if you prefer. This also lets you create special shortcuts that open Firefox’s Profile Manager and launch Firefox with specific profiles if you like.
First, you need to close Firefox completely. Next, you’ll need to launch Firefox with the -pswitch.
- On Windows: Press Windows + R, type firefox.exe -p into the Run box that appears, and then press Enter.
- On Mac: Open a Terminal window—press Command + Space, type Terminal, and press Enter to do it from Spotlight. At the prompt, type /Applications/Firefox.app/Contents/MacOS/firefox-bin -profilemanager and then press Enter.
- On Linux: Open a terminal and run the firefox -profilemanager command.
Start Profile Manager:
- Windows: Open RUN & Enter “firefox.exe -p”
Create Custom Profile in Windows:
- In the Run dialog box, enter “firefox.exe -p” and then Click OK.
- Click the "Create Profile" button to create your custom profile.
Note: If the Profile Manager window does not appear, close all instances of Firefox then you may need to include the full path to the Firefox program, enclose that line in quotes, then add a space followed by -P.
- Now you will get a Create profile wizard, Click Next & proceed further.
- Now enter “New Profile Name” & finish the process.
- Your custom profile is now created now. To check this profile, Simply select the newly created profile & start Firefox.
To use this profile inside Leapwork, specify the profile path in the "Start Web Browser" block. The Browser window that it will launch will be as per the specified profile.
For any clarification, please contact our Priority Support.