What is the purpose of creating a reference variable- ‘driver’ of type WebDriver instead of directly creating a FireFoxDriver object or any other driver’s reference in the statement Webdriver driver = new FirefoxDriver();?
Hey Richard,
Think of it like having a universal remote for browsers. With a WebDriver reference, you can easily switch between different browsers (like Chrome or IE) by just changing the assigned driver, making your code more adaptable and versatile.
feel free to reach out to us if in case any doubt.