in Selenium by
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

0 votes
by
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.,

Related questions

0 votes
asked Aug 22, 2019 in Selenium by john ganales
0 votes
asked Aug 22, 2019 in Selenium by john ganales
0 votes
asked Aug 22, 2019 in Selenium by john ganales
...