What is the main purpose of using Firefox Profiles in Selenium

0 votes
What is the main purpose of using Firefox Profiles in Selenium?
Jul 1, 2019 in Selenium by Jasprit
1,391 views

1 answer to this question.

0 votes

Hello Jasprit, a Firefox profile is a collection of bookmarks, browser settings, extensions, passwords, and history i.e. all of your personal settings. So all of these settings can be changed by creating custom profiles. By using default profile too, you can change user agent, default download directory, browser versions etc. The Profile Manager allows you to createremoverename, and switch profiles. For example, the following lines of code will set the preferred language to french:

FirefoxProfile profile = new FirefoxProfile();
profile.setPreference(“intl.accept_languages”,”fr”);   //set the language to french
driver = new FirefoxDriver(profile);
driver.get("http://google.co.in");
answered Jul 2, 2019 by Jackie

Hi ,When I am Doing This its not taking profile as a argument in FirefoxWebDriver()

Can you plz help!

Hi Shivam, you are facing this issue because FirefoxDriver(profile) method is no longer supported as a valid Constructor. So as you are creating a new FirefoxProfile, you have to use the setProfile() method from the FirefoxOptions Class. So try using these lines of code to resolve the error:

FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("intl.accept_languages", "no,en-us,en");
FirefoxOptions options = new FirefoxOptions();
options.setProfile(profile);
driver = new FirefoxDriver(options);    

Related Questions In Selenium

0 votes
1 answer

What are the main disadvantages of using implicit wait in Selenium?

Hey Aaron, the main disadvantage of implicit ...READ MORE

answered Jun 1, 2019 in Selenium by Abha
• 28,140 points
8,435 views
0 votes
2 answers

What is the role of TestNG & JUnit frameworks in Selenium?

TestNG and JUnit are test frameworks . it ...READ MORE

answered Sep 4, 2020 in Selenium by Sri
• 3,190 points
2,891 views
0 votes
2 answers

what is the need of xpath when you have attributes like id ,class,name in selenium?

some of the controls not have id ...READ MORE

answered Sep 4, 2020 in Selenium by Sri
• 3,190 points
1,795 views
+1 vote
1 answer

What is the working of JSON in Selenium Webdriver Architecture?

JSON stands for JavaScript Object Notation. It is used ...READ MORE

answered May 8, 2019 in Selenium by Frankie
• 9,830 points
3,299 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,674 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,143 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,221 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,875 views
0 votes
1 answer

What is the use of getOptions() method in Selenium?

Hi Urmila, getOptions() is used to get all ...READ MORE

answered May 31, 2019 in Selenium by Abha
• 28,140 points
10,132 views
+1 vote
2 answers

What is the difference between findElement and findElements in Selenium Webdriver?

FindElement Command -This method locates for the ...READ MORE

answered Feb 11, 2020 in Selenium by anonymous
8,368 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