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 in Selenium by Jasprit
21 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 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
0 votes
1 answer

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

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

answered Apr 18, 2018 in Selenium by king_kenny
• 3,590 points
192 views
0 votes
1 answer

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

It is not necessary that every element ...READ MORE

answered Jun 1, 2018 in Selenium by Vinita
• 220 points
92 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 in Selenium by Frankie
• 9,810 points
36 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,050 points
259 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
628 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
257 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 in Selenium by Abha
• 16,440 points
42 views
0 votes
1 answer

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

Hi Nilaabh, Selenium Webdriver uses findElement and ...READ MORE

answered May 8 in Selenium by Anvi
• 10,310 points
119 views