Why we assign firefox instance to webdriver

0 votes
Why we assign firefox driver instance to WebDriver? WebDriver driver=new FirefoxDriver()

I know that this is kind of Late binding in Java, because we can assign IEDriver or some other instance to WebDriver at later point of time.

1: But this applies to classes, right?

2: WebDriver is an interface, then can we create an object instance of an interface?
Jan 23, 2019 in Selenium by Neha
• 6,300 points
817 views

1 answer to this question.

0 votes
Webdriver is an interface, not a class. We create a Webdriver reference driver and assign it to an object of class FirefoxDriver. To perform the testing on Firefox, make an object of class FirefoxDriver. Likewise, to test on chrome, use Chromedriver class' object and assign it to Webdriver. Webdriver is an interface which is implemented by both FirefoxDriver class and ChromeDriver class(and classes for other browsers like IE, Safari). Objects of only those classes can be assigned to an interface reference which implement that interface(which in this case is Webdriver interface)
answered Jan 23, 2019 by Frankie
• 9,830 points

Related Questions In Selenium

0 votes
1 answer

Why we need to use RemoteWebdriver Not the webdriver in Selenium Grid?

Hi Ramya, we use RemoteWebdriver in Selenium ...READ MORE

answered Jul 5, 2019 in Selenium by Abha
• 28,140 points
4,048 views
0 votes
3 answers

Can we run selenium tests (Firefox) on WebDriver without a GUI?

Hi ,  Yes, you can use headless browsers ...READ MORE

answered Sep 2, 2020 in Selenium by Sri
• 3,190 points
4,019 views
0 votes
1 answer

Why to use WebDriver instead of Selenium IDE?

Selenium IDE is a Record and Playback ...READ MORE

answered Jul 11, 2018 in Selenium by Meci Matt
• 9,460 points
1,006 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
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
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
1 answer
0 votes
1 answer

How to send ALT/SHIFT/CONTROL key in Selenium WebDriver?

When we generally use ALT/SHIFT/CONTROL keys, we ...READ MORE

answered Feb 8, 2019 in Selenium by Frankie
• 9,830 points
15,826 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