1.

Explain the statement WebDriver driver = new FirefoxDriver(); ?

Answer»

WebDriver is an Interface which is implemented by FirefoxDriver Class.

FirefoxDriver is a class. It implements all the METHODS of WebDriver interface.

It MAKES the reference of the interface and makes an OBJECT of FirefoxDriver so as to call implemented methods of WebDriver interface.

We declare the left-hand SIDE variable as WebDriver and right-hand side to create an object for a particular type of the browser and ASSIGN it.

WebDriver driver = new FirefoxDriver();


Discussion

No Comment Found