How can we create a new Firefox profile for Selenium WebDriver?

0 votes

If I write something similar to this:

FirefoxProfile ffprofile = new FirefoxProfile(new File("D:\\Selenium"));

Am I creating a new Profile? Because I'm not able to find the new profile in Firefox's Profile section. And, if that's not how you do it, then can someone tell me how to create a new profile? 

Apr 9, 2018 in Selenium by Martin
• 4,220 points
783 views

1 answer to this question.

0 votes

Okay so first of all, in the code you've used above, your not creating a new Firefox Profile. Your just creating a new object instance of Firefox profile class. And moreover your not creating a profile for firefox using Selenium, but instead your creating a Firefox profile for your WebDriver from the already existing profiles in Firefox.

FirefoxProfile ffprofile = new FirefoxProfile(new File("D:\\Selenium"));
WebDriver driver = new FirefoxDriver(ffprofile);

When you execute this command, a new object of Firefox profile will be instantiated and the profile setting which will get imported will be those settings saved in the file in the mentioned location: "D:\\Selenium". 
At this point, do note that you are using an existing profile and not creating a new profile. Selenium cannot do it for you.
If you want to create a new profile, then follow this documentation: https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles

answered Apr 9, 2018 by nsv999
• 5,110 points

Related Questions In Selenium

0 votes
1 answer

How can I create a POM test case in Selenium Webdriver?

Hey Akshay, follow these steps to create ...READ MORE

answered May 12 in Selenium by Anvi
• 13,960 points
73 views
0 votes
1 answer
0 votes
1 answer

What is the default profile for Selenium WebDriver?

While using Firefox in Selenium WebDriver 3.0, ...READ MORE

answered May 14, 2018 in Selenium by Meci Matt
• 9,420 points
624 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,110 points
965 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
1,125 views
0 votes
2 answers
0 votes
2 answers