Selenium WebDriver Interview Questions & Answers

  1. Question 1. What Is Selenium Webdriver?

    Answer :

     WebDriver is designed to provide a simpler, more concise programming interface in addition to addressing some limitations in the Selenium-RC API. Selenium-WebDriver was developed to better support dynamic web pages where elements of a page may change without the page itself being reloaded. WebDriver’s goal is to supply a well-designed object-oriented API that provides improved support for modern advanced web-app testing problems.Selenium-WebDriver makes direct calls to the browser using each browser’s native support for automation. 

  2. Question 2. How To Write The Tests In Selenium Webdriver?

    Answer :

    In selenium WebDriver, depending on the programming language, I used different test framework. In C#, I used NUnit, and in Java, I used JUnit. In either programming language, I defined browser webdriver in setup method, and wrote test steps in test method and dispose and close the webdriver in the tear down method. 

  3. SILK TEST Interview Questions

  4. Question 3. How To Configure Selenium Webdriver In Eclipse?

    Answer :

    In eclipse, I created java projects and added JUnit or TestNG classes. In the project reference, I added JUnit or TestNG jar file.  In the test class, I used webdriver in setup, test and teardown methods. Sometimes, I used webdriver in beforeclass, beforemethod, aftermethod, afterclass sections.

  5. Question 4. What Are The Prerequisites To Run Selenium Webdriver?

    Answer :

    Depending on the programming language, reference files should be added to the test solutions in C# or test projects in Java. For example, in C#, I added webdriver dlls and in Java, I added Selenium-client-driver.jar file. And also, we should have programming IDE like visual studio or eclipse to run webdriver.

  6. QTP Tutorial

  7. Question 5. What Is The Difference Between Selenium 1.0 And Webdriver?

    Answer :

    Selenium 1.0 needs Selenium RC to run a test. However, webdriver can directly launch a browser and run tests. 

  8. QTP Interview Questions

  9. Question 6. What Are The Advantages Of Selenium Webdriver?

    Answer :

    Selenium WebDriver is very flexible to use with Java, .Net, Python, Ruby or html languages. QA engineers who have good coding skills can use it very effectively. 

  10. Question 7. What Are The Disadvantages Of Selenium Webdriver Over Selenium 1.0?

    Answer :

    Since selenium web driver requires coding skills, QA engineers should have some knowledge of program development in Java, .Net, or other languages. 

  11. Selenium Tutorial
    Manual Testing Interview Questions

  12. Question 8. How To Handle Multiple Windows In Selenium Webdriver?

    Answer :

    We can use web driver’s windows handler to identify each window and use switch method to pick the window for test. 

  13. Question 9. How To Navigate With Browser Buttons In Selenium Webdriver?

    Answer :

    We can use web driver’s back or forward method to simulate browser’s navigation button functionality. 

  14. Selenium Interview Questions

  15. Question 10. Which Are The Locators Used For Recognizing The Objects In Selenium Webdriver?

    Answer :

    In webdriver, we can use element id, name, css, xpath, link text, partial link text and DOM to locate elements. 

  16. JMeter Tutorial

  17. Question 11. How To Run The Tests In Internet Explorer Using Selenium Webdriver?

    Answer :

    When setup a webdriver in the code, we can select InternetExplorerDriver to use ID. If we want to use of the latest and greatest features of the WebDriver “InternetExplorerDriver”, we need to download Internet Explorer Server. 

  18. JMeter Interview Questions

  19. Question 12. How To Run The Tests In Firefox Using Selenium Webdriver?

    Answer :

    In the setup method, we select FirefoxDriver for the webDriver.

  20. SILK TEST Interview Questions

  21. Question 13. How To Run The Tests In Google Chrome Using Selenium Webdriver?

    Answer :

    Sometimes, webdriver cannot launch chrome directly, so (1) we can use Desired Capabilities of WebDriver, put chrome browser application path in the code ; (2) we need to have chromedriver.exe file in the application path. Alternatively, we can manually start chrome driver service, and then launch the test in chrome. 

  22. Software testing Tutorial

  23. Question 14. How To Run The Tests Without A Browser Or With Html Unit Driver In Selenium Webdriver?

    Answer :

    WebDriver driver = new HtmlUnitDriver();

  24. Question 15. How To Run Selenium 1.0 Tests In Webdriver?

    Answer :

    We can use WebDriverBackedSelenium to run Selenium 1.0 tests in webdriver. 

    WebDriver driver = new FirefoxDriver();

    Selenium selenium = new WebDriverBackedSelenium(driver, “http://www.yoursite.com”);

  25. Automation Testing Interview Questions

  26. Question 16. How To Convert Selenium 1.0 Tests To Webdriver Tests?

    Answer :

    We can use WebDriverBackedSelenium to run Selenium 1.0 tests in webdriver. 

    WebDriver driver = new FirefoxDriver();

    Selenium selenium = new WebDriverBackedSelenium(driver, “http://www.yoursite.com”);

  27. JUnit Tutorial

  28. Question 17. What Is Webdriver Backed Selenium?

    Answer :

    WebDriver backed Selenium is API that enables running Selenium 1.0 tests in web driver. 

  29. Software testing Interview Questions

  30. Question 18. When To Use Web Driver Backed Selenium?

    Answer :

    When we have existing tests in Selenium 1.0 (RC), if we want to avoid using Selenium RC, instead we want to use web driver, we need to use web driver backed selenium. 

  31. QTP Interview Questions

  32. Question 19. Which Version Of Selenium Ide Supports Webdriver?

    Answer :

    Any version higher than 2.0 supports webdriver.

  33. TestNG Tutorial

  34. Question 20. How To Invoke An Application In Webdriver?

    Answer :

    We can use Process to invoke application in the code using web driver.

  35. JUnit Interview Questions

  36. Question 21. Which Of Selenium Ide Commands Not Supported In Webdriver?

    Answer :

    It depends on the format of conversion functionality of Selenium IDE to web driver. sometimes, not all IDE script can be converted to web driver without any problem.  

  37. Question 22. Where To Download Selenium Webdriver?

    Answer :

    Selenium WebDriver libraries can be download from http://www.seleniumhq.org website.

  38. SAP Testing Tutorial

  39. Question 23. What Is Implicit And Explicit Wait In Selenium Webdriver?

    Answer :

    Explicit wait: An explicit waits is code you define to wait for a certain condition to occur before proceeding further in the code. The worst case of this is Thread.sleep(), which sets the condition to an exact time period to wait. There are some convenience methods provided that help you write code that will wait only as long as required. WebDriverWait in combination with ExpectedCondition is one way this can be accomplished.

    Implicit wait : An implicit wait is to tell WebDriver to poll the DOM for a certain amount of time when trying to find an element or elements if they are not immediately available. The default setting is 0. Once set, the implicit wait is set for the life of the WebDriver object instance.

  40. TestNG Interview Questions