0 votes
in Selenium by
As seen below, we establish a WebDriver reference variable called 'driver.' What exactly is the purpose of proceeding in this manner?

1 Answer

0 votes
by
WebDriver driver = new FirefoxDriver();

instead of creating

FirefoxDriver driver = new FirefoxDriver();

We may use the same driver variable to work with any browser we want, such as IEDriver, SafariDriver, and so on if we construct a reference variable of type WebDriver.

Related questions

0 votes
asked Aug 22, 2019 in Selenium by john ganales
+4 votes
asked Dec 5, 2022 in Machine Learning by sharadyadav1986
...