Can anybody explain me what exactly the difference between the below code?

Answered

Dear All,
Can anybody explain me what exactly the difference between the below code


WebDriver driver;

File pathToBinary=new File("FIREFOX_PATH ");

FirefoxBinary ffBinary=new FirefoxBinary(pathToBinary);

FirefoxProfile ffProfile=new FirefoxProfile();

driver=new FirefoxDriver(ffBinary,ffProfile);

OR

WebDriver driver=new FirefoxDriver();

Thanks&Regards
Samba.

samba Train Asked on December 13, 2014 in Selenium WebDriver.
Add Comment
1 Answer(s)
Best answer

Hi Sambha

File pathToBinary=new File("FIREFOX_PATH ");

U must be Concened  about this line  Suppose you have Firefox 32 in your System and you Wanted to Run your test against firefox 22
so in that Case  u can get binaries for firefox 22 and run ur test case against firefox 22

FirefoxProfile ffProfile=new FirefoxProfile();

Suppose

you Want to Use FireFox With some changed Settings in That Case u Can give the name of Profile Created by you With your Settings

WebDriver driver=new FirefoxDriver();
and in this Case it will launch your default Firefox say
if u have 32 with default firefox profile

anything else u wanna knw..?

ankit ramola Vice Professor Answered on December 13, 2014.

Dear Ankit,
In  the above mentioned code never specify version of the firefox, and you said  we can get binaries for particular version firefox. so can you explain some more details to get particular binaries and what are the settings we have to give with FirefoxProfile. Let me know please.

Thanks&Regards
Samba.

on December 14, 2014.

Hi
u can search on google for how to create a Firefox profile and and settings depends on you
i mean suppose u wanted to change some firefox setting according to you
and binaries are nothing other than the Extracted Version of Firefox Setup
what you have to do is simply give path where you have extracted you Firefox Setup

on December 14, 2014.

Very well explained Ankit.

For Firefox Profile foloow this article:
http://www.toolsqa.com/selenium-webdriver/custom-firefox-profile/

Please close the question now.

on December 15, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.