0 votes
in Selenium by
We do create a reference variable ‘driver’ of type WebDriver as shown below. What is the purpose of doing this way?

1 Answer

0 votes
by

WebDriver driver = new FirefoxDriver();

instead of creating

FirefoxDriver driver = new FirefoxDriver();

WebDriver driver = new FirefoxDriver();

 

instead of creating

 

FirefoxDriver driver = new FirefoxDriver();

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 13, 2021 in Python Pandas by SakshiSharma
0 votes
asked Aug 22, 2019 in Selenium by john ganales
...