Selenium Automation Testing Interview Questions for Freshers (2026)

If you’re applying for QA, automation testing or software tester roles, Selenium with Java is one of the most common skills listed in fresher job descriptions. Interviewers rarely ask for deep framework design from a fresher. They check whether you understand the basics clearly and can write simple, correct code.
The short answer: to clear a fresher Selenium interview, be strong in six areas: locators, waits, handling web elements (dropdowns, alerts, frames, windows), TestNG basics, Page Object Model, and a simple automation framework structure. This guide organises questions by topic, tags each with a difficulty level, shows Selenium 4 Java code, and points out the common traps.
If you’ve searched for Selenium interview questions for freshers, Selenium with Java interview questions and answers, automation testing interview questions for freshers, Selenium WebDriver interview questions, TestNG interview questions for freshers, Page Object Model in Selenium interview, XPath vs CSS selector interview question, implicit wait vs explicit wait or Selenium course in Pune, this guide is built for you.
HOW TO USE THIS QUESTION BANK
Each section ends with a trap note, a common mistake interviewers notice.
WHAT FRESHERS SHOULD PRIORITISE: AN ILLUSTRATIVE VIEW
This is an illustrative guide, not real hiring data. It shows where to spend study time.
SECTION 1: SELENIUM BASICS
Q1. What is Selenium? [E]
Selenium is an open-source suite for automating web browsers. It’s used to automate testing of web applications across browsers and platforms. It supports several languages, including Java and Python.
Q2. What are the components of the Selenium suite? [E]
Component | Purpose |
|---|---|
Selenium WebDriver | Automates browsers using code (the main one used today) |
Selenium IDE | Record-and-playback browser extension for quick scripts |
Selenium Grid | Runs tests in parallel across machines, browsers and versions |
Q3. Can Selenium test desktop or mobile apps? [E]
Selenium automates web browsers. It does not test desktop applications. Mobile app automation is generally done with other tools such as Appium.
Q4. What are the advantages and limitations of Selenium? [M]
Advantages | Limitations |
|---|---|
Open-source and free | Only web applications |
Multiple languages and browsers | No built-in reporting (use TestNG, extent reports, etc.) |
Large community | Needs programming knowledge |
Integrates with TestNG, Maven, CI tools | Cannot handle captchas or OS-level pop-ups by itself |
Q5. Manual testing vs automation testing: when to automate? [M]
Automate repetitive, stable, high-value tests such as regression and smoke tests. Keep exploratory, usability and frequently changing tests manual.
Trap: don’t say “automation replaces manual testing”. Say it complements it.
SECTION 2: SETTING UP AND A FIRST SCRIPT
Q6. Write a basic Selenium script to open a page and print its title. [E]
java
Q7. Do I need to download the browser driver manually? [M]
In recent Selenium 4 versions, Selenium Manager can handle the driver for you automatically, so manual driver setup is often not required. Check your Selenium version’s documentation, since older projects still use manual setup or other helper libraries.
Q8. Difference between close() and quit()? [E]
Method | Behaviour |
|---|---|
| Closes the current browser window |
| Closes all windows opened by the driver and ends the session |
Q9. Difference between get() and navigate().to()? [M]
Both open a URL. navigate() also provides back(), forward() and refresh(). The two are functionally similar for loading a page.
Q10. Why do we write WebDriver driver = new ChromeDriver(); instead of ChromeDriver driver = ...? [M]WebDriver is an interface. Using it as the reference type lets you switch browsers by changing one line and follows the “program to an interface” principle.
Trap: forgetting driver.quit(), which leaves browser processes running.
SECTION 3: LOCATORS (THE MOST-ASKED TOPIC)
Q11. What are locators? List the types. [E]
Locators identify elements on a web page.
Locator | Example |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Q12. Which locator is the best? [M]
Generally, id is the fastest and most reliable when it is unique and stable. When there is no good id, use name, CSS selector or a well-written XPath. The best locator is one that is unique, stable and readable.
Q13. XPath vs CSS selector: what’s the difference? [M]
Point | XPath | CSS selector |
|---|---|---|
Move up to parent | Yes ( | Not directly |
Search by visible text | Yes ( | Not directly |
Syntax | Longer | Shorter |
Typical use | Complex relationships | Simple, clean selection |
Q14. Absolute vs relative XPath? [E]
Type | Example | Problem or benefit |
|---|---|---|
Absolute |
| Breaks when the page structure changes |
Relative |
| More flexible and preferred |
Q15. Write XPaths for common cases. [M]
text
Q16. What are relative locators in Selenium 4? [H]
Selenium 4 introduced relative locators such as above(), below(), toLeftOf(), toRightOf() and near(), which find an element based on its position relative to another
java
Q17. findElement() vs findElements()? [E]
Method | Returns | If not found |
|---|---|---|
| A single | Throws |
| A | Returns an empty list |
Trap: using long absolute XPaths copied from the browser. They break at the smallest page change.
SECTION 4: WAITS (FREQUENT AND TRICKY)
Q18. Why do we need waits? [E]
Web pages load elements at different times. If your script looks for an element too early, it fails. Waits make the script pause until the element is ready.
Q19. Implicit vs explicit vs fluent wait? [E]
Wait | Scope | Key point |
|---|---|---|
Implicit | Global for all | Simple, but not condition-based |
Explicit ( | Specific element or condition | Waits for a defined condition |
Fluent | Specific condition | Adds polling frequency and ignored exceptions |
Implicit wait
java
Explicit wait
java
Fluent wait
java
Q20. What is Thread.sleep() and why is it discouraged? [M]Thread.sleep() pauses for a fixed time whether or not the element is ready. It makes tests slow or flaky. Prefer explicit waits.
Q21. Can we mix implicit and explicit waits? [H]
It is generally recommended to avoid mixing them because the combined behaviour can lead to unpredictable wait times. Choose one approach, commonly explicit waits.
Q22. Common ExpectedConditions? [M]visibilityOfElementLocated, elementToBeClickable, presenceOfElementLocated, titleContains, alertIsPresent, invisibilityOfElementLocated.
Trap: using Thread.sleep() everywhere and calling it “waiting”.
SECTION 5: HANDLING WEB ELEMENTS
Q23. How do you handle a dropdown? [E]
java
The Select class works with HTML <select> dropdowns. Custom dropdowns built with div or ul need normal click actions.
Q24. How do you handle alerts? [E]
java
Q25. How do you handle frames or iframes? [M]
java
Q26. How do you handle multiple windows or tabs? [M]
java
Q27. How do you perform mouse hover, drag and drop or right-click? [M]
java
Q28. How do you handle checkboxes and radio buttons? [E]
java
Q29. getText() vs getAttribute()? [E]
Method | Returns |
|---|---|
| Visible text of the element |
| The value of an attribute, such as the text typed into an input box |
Q30. How do you upload a file? [M]
For <input type="file">, send the file path directly with sendKeys().
java
Q31. How do you take a screenshot? [M]
java
Q32. How do you scroll a page or click using JavaScript? [H]
java
Trap: trying to use Select on a custom dropdown that isn’t an HTML <select> tag.
SECTION 6: COMMON EXCEPTIONS
Exception | Typical cause | Usual fix |
|---|---|---|
| Wrong locator or element not loaded yet | Check the locator and use an explicit wait |
| The page refreshed or the DOM changed after you located the element | Locate the element again |
| Element hidden, disabled or covered | Wait for it to be visible and clickable |
| The wait condition wasn’t met in time | Check the condition and locator |
| Trying to switch to an alert that isn’t open | Wait for the alert first |
| Another element is covering the target | Wait, scroll or close the overlay |
Q33. What is a StaleElementReferenceException? [M]
It occurs when a reference to an element is no longer valid because the page or DOM changed after you found it. Re-locate the element and try again.
SECTION 7: TESTNG BASICS
Q34. What is TestNG and why use it with Selenium? [E]
TestNG is a testing framework that adds annotations, grouping, parallel execution, data-driven testing, assertions and reporting, which Selenium alone doesn’t provide.
Q35. Common TestNG annotations and order? [E]
Q36. A simple TestNG test with Selenium [M]
java
Q37. What is the difference between Assert and SoftAssert? [M]
Type | Behaviour |
|---|---|
| Stops the test at the first failure |
| Continues after a failure and reports all failures when |
Q38. What is a @DataProvider? [M]
java
Q39. Useful @Test attributes? [M]priority, enabled, dependsOnMethods, groups, invocationCount, timeOut, expectedExceptions.
Q40. What is testng.xml? [M]
An XML file used to configure and run suites, tests, classes, groups and parallel execution.
Trap: forgetting that @BeforeMethod runs before every test method, not once.
SECTION 8: PAGE OBJECT MODEL (POM) AND FRAMEWORK
Q41. What is the Page Object Model? [E]
POM is a design pattern where each web page has a corresponding class that holds its locators and actions. Tests call methods from the page class rather than using locators directly.
Q42. Why use POM? [E]
Benefit | Meaning |
|---|---|
Maintainability | If a locator changes, fix it in one place |
Reusability | The same page methods serve many tests |
Readability | Tests read like real user steps |
Q43. A simple POM example [M]
java
java
Q44. What is PageFactory and @FindBy? [H]PageFactory initialises elements declared with @FindBy annotations in page classes. Many teams today prefer plain By locators, so be ready to explain both approaches.
Q45. What does a basic automation framework contain? [M]
Common parts: a base class for driver setup and teardown, page classes, test classes, utilities (waits, screenshots, reading data), test data files (Excel, JSON, properties), reports and version control (Git).
Q46. What is a data-driven or keyword-driven framework? [H]
A data-driven framework runs the same test with multiple data sets from files or a database. A keyword-driven framework controls test steps with keywords stored outside the code. Be ready to explain what you have actually built, not just the definitions.
Trap: describing a framework you haven’t built. Interviewers often ask follow-ups.
SECTION 9: GRID, CROSS-BROWSER AND CI BASICS
Q47. What is Selenium Grid? [M]
Selenium Grid allows tests to run on multiple machines, browsers and operating systems in parallel, which saves time and enables cross-browser testing.
Q48. How do you run tests in headless mode? [M]
java
Headless mode runs the browser without a visible window, which is useful on servers and CI pipelines. Exact flags can vary by browser version.
Q49. What is Maven’s role in a Selenium project? [E]
Maven manages dependencies (Selenium, TestNG) through pom.xml and builds and runs the project.
Q50. What is CI/CD and how does it relate to automation? [H]
Tools such as Jenkins can run your automated tests automatically on every build or on a schedule, so failures are caught early.
SECTION 10: SCENARIO QUESTIONS FRESHERS OFTEN GET
Scenario | A solid approach |
|---|---|
“Your script fails only sometimes. Why?” | Likely timing or synchronisation. Use explicit waits and stable locators. |
“Element is present but click fails.” | It may be hidden, covered or not yet clickable. Wait for clickability, scroll into view or check for overlays. |
“Locator keeps changing.” | Use more stable attributes, relative XPath, CSS or ask developers to add stable test ids. |
“How would you test a login page?” | Valid and invalid credentials, empty fields, error messages, password masking, boundary cases and navigation after login. |
“Which tests would you automate first?” | Smoke and regression tests that are stable and repeated often. |
“What do you do when a test fails?” | Reproduce manually, check logs and screenshots, decide whether it’s a script issue, environment issue or a real bug, then fix or report it. |
MYTH VS REALITY
Myth | Reality |
|---|---|
“Selenium can automate everything.” | It automates web browsers, not desktop or native mobile apps. |
“More XPath tricks means better tester.” | Clean, stable locators matter more than clever ones. |
“Thread.sleep() is fine for waits.” | It slows and destabilises tests. Prefer explicit waits. |
“Automation testers don’t need manual knowledge.” | Good test design and bug-finding skills come from manual testing basics. |
“Learning Selenium alone is enough.” | Java basics, SQL, TestNG, Git and a framework understanding matter too. |
“Freshers need a huge framework.” | A clean, small framework you built yourself and can explain is better. |
A 4-WEEK SELENIUM PREPARATION PLAN
Week | Focus | Practice |
|---|---|---|
1 | Java basics: OOP, collections, exceptions | Write small programs daily |
2 | Selenium basics: setup, locators, XPath, CSS | Automate a demo site’s login and search |
3 | Waits, dropdowns, alerts, frames, windows, Actions | Handle each element type at least once |
4 | TestNG, POM, a small framework, Git | Build a mini project and put it on GitHub |
Mini project idea: automate login, search, add-to-cart and checkout flow on a public practice website using Java, TestNG, POM and Maven, with screenshots on failure and a simple report.
HOW VIBRANTMINDS HELPS YOU BECOME AN AUTOMATION TESTER
VibrantMinds Technologies Pvt. Ltd. trains freshers in Pune for testing careers, with practice built around what interviews and entry-level jobs ask.
Software Testing (Manual + Automation) course: About 2 to 5 months, covering test cases, STLC, bug tracking, SQL and Selenium basics. Please check the candidate portal for the latest syllabus.
Java basics: Core Java support helps you write Selenium scripts with confidence.
Project practice and mock interviews: Build a small automation project and practise explaining it.
Aptitude, communication and resume guidance: So you can present your skills well.
Placement support: The pipeline includes screening, drive coordination and interview support. Check the campus-drives portal at https://candidates.vibrantminds.in/ for current openings.
Honesty first: VibrantMinds offers placement support, not a guaranteed job, and no legitimate recruiter should ask you to pay to be interviewed.
VibrantMinds works as a talent ecosystem connecting candidates, colleges and companies, with 1900+ partner colleges and 600+ hiring companies. Learn more on the official website: https://vibrantminds.in/
VIBRANTMINDS COURSES AT A GLANCE
Course | Duration | Key topics |
|---|---|---|
Software Testing (Manual + Automation) | 2 to 5 months | Test cases, STLC, bug tracking, SQL, Selenium basics |
Full Stack Java Development | 4 to 6 months | Core Java, OOP, JDBC, SQL, Spring Boot, REST APIs, front-end basics, projects, aptitude and interview preparation |
Core Java | 1 to 2 months | Syntax, OOP, collections, exceptions, strings |
Python & Data Science | 2 to 4 months | Python basics, data handling, analysis fundamentals |
Fees, syllabus and batch dates are on https://candidates.vibrantminds.in/. Please confirm them directly before enrolling.
THE VIBRANTMINDS PLACEMENT PIPELINE: SIX STEPS
REAL OUTCOMES: WHAT TO EXPECT AND WHAT NOT TO
Past students have shared positive feedback about the training and support, and have gone on to roles at companies such as Aress Software and Education Technologies, Saama Technologies and Three M Software. Results vary by candidate, skill level, effort and market conditions, so please confirm details directly with the VibrantMinds team. No one can honestly promise a guaranteed job.
JOIN THE VIBRANTMINDS WHATSAPP GROUPS FOR FRESHER JOB AND DRIVE ALERTS
Fresher openings, campus drives and walk-in interviews are shared here as they come in. Join whichever group has space; all three carry the same type of updates.
VibrantMinds Fresher IT Jobs, Group 1: https://chat.whatsapp.com/CUCS1derlmTFee2c9dyUHd
VibrantMinds Fresher IT Jobs, Group 2: https://chat.whatsapp.com/FvMf1fGYQYnHppQ8AwFX40
VibrantMinds Fresher IT Jobs, Group 3: https://chat.whatsapp.com/I7RNnGMkb2L8S8HibdyWpQ
Never pay to apply. Legitimate recruiters do not charge candidates for tests, interviews or offer letters. Do not share sensitive personal or financial details in any group chat.
VISIT OR CONTACT VIBRANTMINDS IN PUNE
Company: VibrantMinds Technologies Pvt. Ltd.
Address: Viva Academy Building, Warje, Pune, Maharashtra 411052
Phone: +91 95035 79517
Email: support@vibrantmindstech.com
Website: https://vibrantminds.in/
Candidate portal and courses: https://candidates.vibrantminds.in/
FREQUENTLY ASKED QUESTIONS
What are the most asked Selenium interview questions for freshers?
Locators, XPath vs CSS selector, implicit vs explicit wait, findElement vs findElements, close vs quit, handling dropdowns, alerts, frames and windows, TestNG annotations, and the Page Object Model.
Is Java required for Selenium?
Selenium supports several languages, but Java is one of the most common in job descriptions. Learn Core Java basics (OOP, collections, exceptions) before Selenium.
What is the difference between implicit and explicit wait?
An implicit wait applies globally to element searches, while an explicit wait pauses for a specific condition on a specific element. Explicit waits are generally preferred for flexibility.
What is the Page Object Model in Selenium?
It’s a design pattern where each page has a class containing its locators and actions, making tests easier to maintain and reuse.
What is the difference between findElement and findElements?findElement returns one element and throws NoSuchElementException if none is found. findElements returns a list, which is empty if nothing matches.
What is the difference between XPath and CSS selector?
XPath can navigate up to parents and match by text, while CSS selectors are usually shorter and simpler. Both are widely used.
Is Selenium enough to get an automation testing job?
Selenium is important, but employers also look for Java basics, SQL, TestNG, Git, manual testing fundamentals and a small framework you can explain.
How long does it take a fresher to learn Selenium?
It depends on your Java background and practice time. With regular practice, many learners cover the basics in a few weeks and need longer to build confidence with frameworks.
Should I learn manual testing before automation?
Yes. Test design, bug reporting and STLC knowledge help you decide what to automate and how.
Does VibrantMinds offer a Selenium and software testing course in Pune?
VibrantMinds offers a Software Testing (Manual + Automation) course covering test cases, STLC, bug tracking, SQL and Selenium basics, plus interview preparation and placement support. Please confirm the latest syllabus on the candidate portal. VibrantMinds does not guarantee a job.
FINAL CHECKLIST
☐ I can write and explain a basic Selenium script
☐ I can write relative XPath and CSS selectors without copying
☐ I can explain implicit, explicit and fluent waits with code
☐ I can handle dropdowns, alerts, frames and windows
☐ I know TestNG annotations and their order
☐ I can explain POM and draw a simple framework structure
☐ I built a small automation project and put it on GitHub
☐ I practised scenario questions aloud
Interviewers don’t expect a fresher to know everything about Selenium. They look for clear basics, clean code and honest explanations of what you’ve built. Learn the topics in this order, build one small project, and practise answering aloud. If you’re in Pune and want guided testing and automation training with interview preparation and placement support, visit https://vibrantminds.in/, check the candidate portal at https://candidates.vibrantminds.in/, and join the WhatsApp groups above for the next drive.


