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();?



What is the purpose of creating a reference variable- 'driver' of type webdriver instead o..

Answer / Anupam Kumar Singh Tomer

Creating a reference variable of type WebDriver, such as 'driver', provides flexibility to switch between different browsers (like Chrome, Firefox, Safari, etc.) during testing by simply changing the driver class. This abstraction allows for more efficient code maintenance and reusability.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Selenium Interview Questions

How to select value in a dropdown?

1 Answers  


Explain Cucumeber Framework?

1 Answers  


How many types of webdriver api's are available in selenium?

1 Answers  


What is the difference between selenium and sikuli?

1 Answers  


How do you fetch the data from the excel

1 Answers  


How do you attach File on a page?

1 Answers   HCL,


Tell me what api is required for database testing in selenium webdriver?

1 Answers  


What You Know About Selenium Grid?

1 Answers  


Explain what are the limitations of selenium ide?

1 Answers  


From your test script how you can create html test report?

1 Answers  


What is the difference between driver.getwindowhandle() and driver.getwindowhandles() in selenium webdriver?

0 Answers  


From selenium ide how you can execute a single line?

1 Answers  


Categories