Categories

Aug 22, 2019 in Selenium

Q: We do create a reference variable ‘driver’ of type WebDriver

WebDriver driver = new FirefoxDriver();

instead of creating

FirefoxDriver driver = new FirefoxDriver();

1

2

3

4

5

WebDriver driver = new FirefoxDriver();

 

instead of creating

 

FirefoxDriver driver = new FirefoxDriver();

What is the purpose of doing this way?

1 Answer

Aug 22, 2019
If we create a reference variable driver of type WebDriver then we could use the same driver variable to work with any browser of our choice such as IEDriver, SafariDriver etc.,
Click here to read more about Selenium
Click here to read more about Insurance

Related questions

Madanswer
Aug 22, 2019 in Selenium
Aug 22, 2019 in Selenium
Aug 22, 2019 in Selenium
...