Selenium Interview Questions

Eveline D'souza
2 min readMar 22, 2022

Here’s a curated list of questions which have been asked to me, friends and some from the websites regarding the interview feedbacks.

  • Explain Selenium architecture.
  • Explain your Automation framework
  • What are the different types of wait? Can also be asked as How do you handle synchronisation in selenium?
  • Program to take screenshots?
  • How to check if all the links on the page are working without clicking on any of the link?
  • What are various exceptions you have come across and how did you handle it?{commonly asked- StaleElementReferenceException }
  • Name all the interfaces used in selenium
  • Explain the code Webdriver driver = new Chromedriver(); Internal working when this line is executed
  • How to switch to frame/ alerts/ window/ tab?
  • What are the inbuilt methods for Alerts?
  • How to find the names of all open tabs ?
  • How to find attributes of an element?
  • How to fetch the text of an element?
  • Difference between findElement() and findElements(). Can also be asked as — If there’s an element on the webpage which may or may not appear everytime. How do I handle it such that there is no exception thrown?
  • What is findElement in the Selenium statement “driver.findElement(By.xpath(‘ ’ )) “ ?
  • Name all the type of locators
  • What are the 2 types of xpaths?
  • How does X-path traverse within the DOM?
  • Write an Xpath to return the count of rows in a table contains the word ‘Testing’. Or will be asked to write xpath for finding an element by opening some website. Or to write using Advanced Xpath functions.
  • Can CCS Selector traverse backward in the DOM
  • Which locator do you think is the best and the worst locators to be used?
  • Which are the element locators? Which is the fastest? Which is the slowest?
  • How to handle dynamic web-table?
  • I have a webpage with 10 textboxes having same name, same attributes, same id, class name, everything same. How would you find the second last textbox?
  • How to validate text from a textbox which disappears on clicking inside the textbox?
  • What are the alternate ways of entering text into a textbox without using sendKeys method?
  • How to check if the values in the dropdown are in ascending order?
  • Suppose there is a button which downloads a PDF file on clicking on it. How to download a file and save it to a particular location ?
  • How does Selenium interact with a download/print dialog?
  • Write a program to handle 10 different windows.
  • Write a program to upload a file in selenium.

Happy Learning !!

--

--

Eveline D'souza

Just an Automation Test Engineer taking notes while learning.