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 10, 2018 in Selenium by Martin
• 4,320 points
4,630 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 10, 2018 by nsv999
• 5,500 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 13, 2019 in Selenium by Anvi
• 14,150 points
1,486 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
3,797 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,500 points
13,768 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

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

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,187 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,910 points
7,261 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 2, 2020 in Selenium by Sri
• 3,190 points
4,059 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 23, 2019 in Selenium by Abha
• 28,140 points
1,463 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP