Firefox's profile is one of the important feature about the Firefox, We need profile if we want to Customize out.
Why do we need a Firefox Profile?
To create your own automation profile that you can use in Automation.
Every time the same profile is used so that the download folder and other things are be cached or the same.
You can install custom add-on which are always available in the Firefox profile.
How to create Firefox Profile?
Open the Firefox and open this URL “about:profiles”
Click on the create new profile.
Open that profile and install your favorite add-ons like ad blocker, multipass for this demo to work.
How to Customize Download folder, and other add-on to Firefox profile?
You can customize the download folder if you are testing some download functionality in the selenium with the profile.
This is helpful in downloading and verifying file test cases, you can use the hard coded path in the profile every time.
Customize downloads, and added add-on are available in Profile every time you launch the profile with the Firefox profile options.
How to bypass Basic auth using Firefox Profile in Selenium?
Suppose you have a test case where you have to open a basic auth popup. Problem with the Basic auth is that it is popup and very hard to automate in Selenium.
You can’t directly use the driver.switchTo() method here.
Now You can use these methods
Method 1 :
Easy way to open the URL with the https://username:email@example.com , so the URL for the demo becomes https://admin:firstname.lastname@example.org/basic_auth
But for some websites it doesn’t work, We have to use certain add-ons to handle the popup, thankfully we have a plugin like multi pass where you can save the username, password and URL it will automatically put all the details.
So steps are
- Just create a Profile with multi pass add-on and URL with details or credentials.
- Open the URL in the same profile.
- Multi pass will automatically put the credentials and login to the portal.
- Verify the home page.