Oracle Interview Question

Is Webdriver a class or interface?

Interview Answers

Anonymous

Mar 29, 2018

It is an Interface.

Anonymous

Jul 12, 2018

Webdriver is basically an Interface which is always implemented by any of browser class like ChromeDrive() , FirefoxDriver(), OperaDriver() etc.

Anonymous

May 6, 2020

WebDriver is an interface which can be implemented by the class which implements it. ChromeDriver,geckoDriver,IEDriver these are the class which implements the webdriver interface . Since webdriver is an interface it contians all the abstract methods .These methods are implemented by the class implementing the interface . Hence in our code we write WebDriver driver = new ChromeDriver(); we can also write ChromeDriver driver = new ChromeDriver(); But here we can only invoke methods that are of chrome driver. Whereas in WebDriver driver = new ChromeDriver(); we can invoke the methods of both chrome driver and webdriver