Top 50+ Selenium and TestNG Interview Questions

Why Selenium?

Selenium with Java is the one of trending skill in Software Testing Domain where most of the jobs are posted. Most of the CMMI V companies prefer to hire Quality Analyst with this skill set. Even this is best profile to enter into coding from Manual Testing. This article helps you to get most common interview questions.

Popular JD For QA’s

Generally Job description posted for following requirements:

  • Core Java (Mandatory Skill Set)
  • Selenium (Mandatory Skill Set)
  • Testng/Cucumber(BDD) (One is mandatory)
  • Database Knowledge
  • Manual Testing  and API Questions

Skills Required For Automation Profile?

Core Java:

This is the one of most important skill set for Automation Tester and most of the time it’s deciding skill. Refer below for questions:

Java Interview Question required for Selenium:

  1. Name some OOPs concepts of Java?
  2. What do you understand with Polymorphism?
  3. What is difference between Abstarct class and Interface and why it is used?
  4. What is static Keyword and why it is used?
  5. What is difference between final, finally and finalize?
  6. What is difference between throws and throw?
  7. Can an Interface implement or extend another interface ?
  8. What is marker Interface?
  9. Can we have try without catch block?
  10. Difference between String, StringBuilder and StringBuffer?
  11. Why String is popular HashMap key in Java?
  12. What is difference between comparator and comparable class?
  13. Write a Java program to check Palindrome?
  14. Write a java program to found duplicate words from sentence. Ex. Sentence = “AGRA IS MY HOMETOWN AGRA NOIDA AGRA”. Output: AGRA 3
  15. Write a java program to find duplicate characters from string.
  16. Write java program to find number from given string. ?
  17. Write a java program to print reverse sentence in reverse order ?Input: “INDIA IS MY HOME COUNTRY”. Output: “COUNTRY HOME MY IS HOME”
  18. Write a java program to read data from notepad.
  19. Write a program to count files in given directory.
  20. What is Maven and why it is used?
  21. What are Life cycles of Maven?
  22. Which code management tool you used? Write few git command to create branch, clone and commit?


After completion of Core Java round interviewer moved on Selenium Concepts. Here are top questions

Selenium Interview Questions:

  1. Write code to capture screenshot?
  2. Write selenium code to assert all links are working and there is no broken links on page.
  3. How to switch within Iframes.
  4. Write relative Xpath using following ancestor and following siblings.
  5. Why we use WebDriver Manager ?
  6. What are methods available in WebDriver Event Listener interface?
  7. Explain internal architecture of Selenium WebDriver ?
  8. Why and how you use Selenium Grid ?
  9. How to get details of multiple windows and how to switch between Windows.
  10. How you get data from WebTables ?
  11. What is desired capabilities and why it is used ?
  12. What are different types of Wait available in Selenium?
  13. What is difference between implicit and explicit wait?
  14. What are the common exceptions found during Selenium Automation and how you handle?
  15. Explain your automation framework and what are the features in it?
  16. Write few utilities code like excel reader, csv reader and  JDBC connection code.


Testng is one of the popular framework in industries so most of the interviewer like deep dive into it.

TestNg Interview Questions:

  1. Why testing is used in Automation framework?
  2. What is difference between Hard assert and soft assert.
  3. How to pass parameter from testing xml.
  4. How to run test classes parallel and how test methods.
  5. Write structure of testing xml structure.
  6. How you run Testng xml from command line.
  7. What are the annotations available in Testng and what are sequence of their execution.
  8. How to ignore a test in testng.
  9. How to use dataProviders in Testng?
  10. How to run failed testcase using testng xml.?

Cucumber BDD:

One of the demanding framework and used in most of the MMCs. Good answers on Cucumber ensure your selection. Here is the interview questions:

Cucmber BDD Interview Questions:

  1. What is BDD (Behavioral Driven Development) framework and why it is used?
  2. Which language is used to write feature file?
  3. What are components of feature file?
  4. What is the difference between Scenario and Scenario Outline?
  5. How you run Cucumber feature file ?
  6. How you perform Data Driven Testing with Cucumber ?
  7. What is the purpose of Step Definition file ?
  8. Why Background Keyword is used?

Database Testing:

Being a senior Software Test Engineer, Database knowledge is mandatory. Here are the important Database questions for Automation Engineer:

Database Testing Interview Questions:

  1. What are difference between truncate, delete and drop commands?
  2. Write query to find third highest salary of employee?
  3. What is the difference between view and table?
  4. What is the difference between procedure and trigger?
  5. What is stored procedure?
  6. What is a cursor?
  7. What are the string functions?
  8. What is coalition?

Manual & API Testing:

A automation tester is best if he have gene of Manual Tester. He should be good in scenario creation, test plan and Test strategy and agile methodology. Here are few important questions which interviewer likes to ask at the end of interview.

Manual & API Testing Interview Questions:

  1. What are agile ceremonies involved in Project Life Cycle?
  2. What is story point and who gave these story points?
  3. What is difference between project backlog and sprint backlog?
  4. What is burn down chart?
  5. What is the difference between test strategy and test plan?
  6. What is Kanban ?
  7. Difference between extreme programming and scrum?
  8. What is the velocity of Sprint   and how it is measured?
  9. What are the some common architectural style of creating a web api ?
  10. What are the principle of API Test Design?
  11. What is the procedure to perform API Testing?
  12. What are the major challenges you faced in API Testing?
  13. What is the difference between POST and PUT Request?
  14. What are the common response codes of API ?
  15. What is the difference between PATCH and UPDATE?
  16. What are the differences between SOAP and REST API?
  17. What do you understand by Continuous Integration and How you will achieve  this?

Above questions are enough to crack interview any Senior Automation Engineer role. Thought Coders website have very good content which helps you to learn technologies and crack interview. Explore our website and share your feedback on

Subscribe to our Newsletter:

5 1 vote
Article Rating

Subscribe to our Newsletter:

Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x
Open chat
Feel free to contact