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,210 points
307 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,030 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
• 5,880 points
16 views
+2 votes
1 answer

How can we handle authentication popup in Selenium WebDriver using Java

The Alert Method, authenticateUsing() lets us skip ...READ MORE

answered Apr 18, 2018 in Selenium by king_kenny
• 3,590 points
2,900 views
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,400 points
223 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,030 points
66 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
438 views
0 votes
1 answer

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

You can explore options like HTMLUnit Driver ...READ MORE

answered Mar 23, 2018 in Selenium by nsv999
• 5,030 points
162 views
0 votes
1 answer

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

We can take screenshots using below function ...READ MORE

answered Mar 23, 2018 in Selenium by nsv999
• 5,030 points
109 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.