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
119 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 May 31, 2019 in Selenium by Abha
• 27,930 points
1,137 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 in Selenium by Sri
• 2,970 points
824 views
0 votes
2 answers
+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,810 points
1,123 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,494 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,500 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,582 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 2 in Selenium by Sri
• 2,970 points
2,816 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
• 27,930 points
3,764 views
+1 vote
2 answers