Test Your Basics of Selenium WebDriver – Java By Answering These Interview Questions

Following is a list of basic questions of Selenium WebDriver – Java. It will help you to test your basic knowledge as well as for interviews as well. All the best.

  1. What are the locators available in Selenium WebDriver?
  2. What are difference between findElement() and findElements()?
  3. How can you launch any browser in Selenium WebDriver?
  4. Why we need to set browser executable path as system properties to launch a chrome browser?
  5. What error will be hrown when browser executable path is not set.
  6. What are differences between get() and to() mehods?
  7. What are difference between Selenium webDriver click() and Javascript click()?
  8. Explain some methods of Xpath.
  9. What are limitation of CSS Selector?
  10. What is difference between name and className locators?
  11. What are differences between absolute Xpath and relative Xpath? Which is preferred?
  12. List some important interfaces in Selenium WebDriver?
  13. What are methods available in WebElement interface?
  14. What are methods available in WebDriver interface?
  15. What is RemoteWebDriver?
  16. Which interface is used to capture screenshot?
  17. Which interface is used to run Javascript commands?
  18. Is it mandatory to up cast browser driver class object to WebDriver?
  19. How you will identify if a check box is checked?
  20. How you will identify if a radio button is selected?
  21. How you will identify presence of a WebElement?
  22. How you will identify absence of a WebElement?
  23. How you will identify viability of a WebElement?
  24. How you will identify invisibility of a WebElement?
  25. Write code snippet to find a element using any locator.
  26. Write code snippet to find multiple elements and get the size?
  27. Write code snippet to capture screenshot.
  28. Write code snippet to execute a Javascript query.
  29. Write code snippet to retrieve a text of an element. Assert if it is not null.
  30. How to retrieve current url? Write code snippet and split the website name only. For example :- www.facebook.com , then extract only “facebook”.
  31. How to get current title of a page? Can a web page be without title?
  32. What are differences between WebDriver and WebElement?
  33. What are waits provided by Selenium WebDriver?
  34. How implicit wait is different from explicit wait in Selenium?
  35. What is WebDriverWait?
  36. Write code snippet to configure a WebDriverWait instance.
  37. Write code snippet to configure a FluentWait instance.
  38. What are differences between WebDriverWait and FluentWait?
  39. What is NoSuchElementException?
  40. When you get TimeoutException in Selenium?
  41. When does StaleElementReferenceException occur?
  42. How to get all clickable links from a web page?
  43. How to find broken links of a web page?
  44. What is page load timeout and how you set it?
  45. Write code snippet to configure implicit wait in Selenium?
  46. What is difference between page load timeout and script time out ?
  47. What are inner interfaces are available in WebDriver interface?
  48. How to navigate through browser history?
  49. What is difference between close() and quit()?
  50. What is By in Selenium WebDriver?
  51. Write code snippet to delete all cookies?
  52. How to get total frame counts including inner frames of a page?
  53. In how many ways we can switch to frame?
  54. What is difference between parentFrame() and defaultContent() methods?
  55. What is window handle?
  56. Can we get a window handle of a window without title?
  57. What is return type of getWindowHandle() and getWindowHandles()?
  58. Write code snippet to navigate through multiple windows and retrieve its title and url.
  59. What is Page Object Model design pattern?
  60. What is PageFactory?
  61. What is difference between POM and PageFactory?
  62. What is @FindBy annotation?
  63. Write code snippet of a simple Page Object class.
  64. What are advantages of using Page Object Model?
  65. What are limitations of using PageFactory?
  66. What are modules in your framework?
  67. What are utilities methods you have added in your framework?
  68. How you read data from excel in Java? Write code snippet.
  69. How to read data from properties file in Java?
  70. How many Selenium frameworks you have come across?
  71. What do you understand by data driven framework and in how many ways we can implement the same?
  72. What do you understand by keyword driven framework and in how many ways we can implement the same?
  73. How you will arrange your test scripts?
  74. What are key factors you consider for stability of tests?
  75. When we get NoSuchWindowException ?
  76. How to verify if an alert is present?
  77. Write code snippet to handle alert?
  78. How you will decide where Alert can be used?
  79. Draw WebDriver hierarchy.
  80. Draw and explain architecture of Selenium WebDriver?
  81. What are challenges you feces while scripting scenarios using Selenium WebDriver?
  82. How to upload a file in Selenium WebDriver?
  83. What is Selenium Grid?
  84. How to scroll to an element in Selenium Webdriver?
  85. What are reporting tools you have used with your selenium framework?
  86. What is Actions class in Selenium and when to use?
  87. How do you select a value in drop down created using select tag?
  88. How to select value in a non-select drop down?
  89. How does Select class work? List out its methods.
  90. How to get CSS properties of a WebElement?
  91. What is difference between getText() and getCssValue() methods?
  92. How many languages bindings of Selenium Webdriver are available?
  93. What is EventFiringWebDriver?
  94. What are alternatives of Selenium?
  95. What are key points you keep in mind while scripting?
  96. What is use of getAtrribute() method?
  97. How to perform mouse hover? How it helps in capturing tooltip?
  98. In which condition sendKeys() can be used to upload file? If sendKeys() does not work then what are alternatives?
  99. How to upload a file to hidden or inaccessible input tag?
  100. What are new features available in Selenium 4?
  101. How to assert if a text box accepts only numbers?
  102. How to implement boundary value analysis while scripting?
  103. How to fetch a specific column in a WebTable?
  104. What are design pattern you have used?
  105. How to select a value from calendar?

If you have any doubt, feel free to comment below.
If you like my posts, please like, comment, share and subscribe.

Find all Selenium related post here, all API manual and automation related posts here and find frequently asked Java Programs here.

Many other topics you can navigate through menu.

2 thoughts on “Test Your Basics of Selenium WebDriver – Java By Answering These Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *