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,340 points
2,156 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,510 points

Related Questions In Selenium

0 votes
2 answers
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, 2019 in Selenium by Anvi
• 14,110 points
368 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,460 points
1,625 views
0 votes
2 answers

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,510 points
3,547 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31 in Selenium by Sri
• 2,970 points
4,552 views
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,890 points
2,603 views
0 votes
3 answers

Can we run selenium tests (Firefox) on WebDriver without a GUI?

Hi ,  Yes, you can use headless browsers ...READ MORE

answered Sep 1 in Selenium by Sri
• 2,970 points
1,123 views
0 votes
2 answers

How can we take screenshots of tests in Selenium 2 using C#

Hey, try using following code command to ...READ MORE

answered Aug 22, 2019 in Selenium by Abha
• 27,930 points
323 views