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
202 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
• 28,040 points
2,192 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,100 points
1,217 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,100 points
837 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,810 points
1,826 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,520 points
5,590 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,100 points
6,185 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
3,839 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, 2020 in Selenium by Sri
• 3,100 points
4,733 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,040 points
5,946 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 10, 2020 in Selenium by anonymous
4,527 views