SoftwareTestPilot
28 Q&A · Freshers

Selenium Interview Questions for Freshers (1970)

28 real Selenium interview questions for entry-level QA roles — WebDriver basics, locators, explicit waits, iframes and windows, Actions class, TestNG essentials, Page Object Model, and 2026 fresher salary bands. Every answer includes runnable Java.

  • 3 min read
  • Difficulty: Easy
  • 0–1 yr · Entry-Level
  • Updated July 1970
  • Avinash Kamble

1. Selenium & WebDriver Basics

Easy Very Common 1 min read

Q1.What is Selenium?

Selenium is an open-source suite for automating web browsers. Its main component, Selenium WebDriver, is a W3C standard API implemented by every major browser. Freshers use it to write scripts in Java, Python, JavaScript, C#, or Ruby.

Easy Very Common 1 min read

Q2.What are the components of Selenium?

  1. Selenium IDE — record-and-playback browser extension
  2. Selenium WebDriver — code-first API (the main one)
  3. Selenium Grid — distributed / parallel execution
Easy Very Common 1 min read

Q3.What is WebDriver?

The W3C-standard programming interface for controlling a browser. Each browser ships its own driver (ChromeDriver, GeckoDriver, EdgeDriver) that translates WebDriver commands into browser-native actions.

Medium Very Common 1 min read

Q4.How do you set up Selenium with Java + Maven?

<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-java</artifactId>
  <version>4.28.0</version>
</dependency>
WebDriver driver = new ChromeDriver();
driver.get("https://example.com");
driver.quit();
Medium Very Common 1 min read

Q5.Do you still need to download ChromeDriver manually?

No — Selenium 4.6+ ships Selenium Manager, which auto-downloads the right driver. You just do new ChromeDriver().

Medium Very Common 1 min read

Q6.What's the difference between driver.close() and driver.quit()?

close() closes the current tab. quit() closes all tabs and ends the WebDriver session. Always quit() in @AfterMethod to avoid leaked browser processes.

Confidence check

If you can confidently answer the Selenium & WebDriver Basics questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

2. Locators & Element Actions

Easy Very Common 1 min read

Q7.What locator strategies does Selenium support?

  • id, name, className, tagName
  • linkText, partialLinkText
  • cssSelector, xpath
  • Selenium 4 relative locators: above/below/toLeftOf/toRightOf/near
Easy Very Common 1 min read

Q8.CSS selector vs XPath — which is better?

Prefer CSS: shorter, faster, cleaner. Use XPath when you need text(), parent axis, or starts-with. Never chain 6 levels of XPath — use test IDs instead.

Medium Very Common 1 min read

Q9.How do you find and click an element?

driver.findElement(By.cssSelector("[data-test='submit']")).click();
Medium Very Common 1 min read

Q10.What's the difference between findElement and findElements?

findElement returns the first match or throws NoSuchElementException. findElements returns a (possibly empty) list — great for checking absence: list.isEmpty().

Medium Very Common 1 min read

Q11.How do you type text and clear a field?

WebElement email = driver.findElement(By.id("email"));
email.clear();
email.sendKeys("qa@example.com");
Medium Common 1 min read

Q12.How do you get text vs attribute value?

element.getText();                 // visible innerText
element.getAttribute("value");    // form input value
element.getDomProperty("value");  // Selenium 4 — live DOM property
Confidence check

If you can confidently answer the Locators & Element Actions questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

3. Waits & Synchronization

Medium Common 1 min read

Q13.Implicit vs Explicit wait — which do you use?

Prefer explicit. Implicit sets a global polling timeout on every findElement; it's blunt and can mask real bugs. Explicit waits target one condition:

new WebDriverWait(driver, Duration.ofSeconds(10))
  .until(ExpectedConditions.elementToBeClickable(By.id("submit")));
Medium Common 1 min read

Q14.What is FluentWait?

Wait<WebDriver> w = new FluentWait<>(driver)
  .withTimeout(Duration.ofSeconds(15))
  .pollingEvery(Duration.ofMillis(500))
  .ignoring(StaleElementReferenceException.class);
w.until(d -> d.findElement(By.id("row-42")));
Easy Common 1 min read

Q15.Should you ever use Thread.sleep()?

Only in test authoring/debugging. In real scripts it's an anti-pattern — replace with explicit waits or the correct ExpectedConditions.

Medium Common 1 min read

Q16.How do you handle a StaleElementReferenceException?

Re-find the element after the DOM change, or wrap the action in a wait+retry (FluentWait ignoring the exception). Cache locators, not WebElements.

Medium Common 1 min read

Q17.How do you assert a page has loaded?

wait.until(ExpectedConditions.urlContains("/dashboard"));
wait.until(ExpectedConditions.titleIs("Dashboard"));
Confidence check

If you can confidently answer the Waits & Synchronization questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

4. Frames, Alerts, Windows & Actions

Medium Common 1 min read

Q18.How do you handle a JavaScript alert?

Alert a = driver.switchTo().alert();
a.getText();
a.accept();  // or a.dismiss();
Medium Common 1 min read

Q19.How do you switch to an iframe?

driver.switchTo().frame("frame-name");
// ... interact ...
driver.switchTo().defaultContent();
Medium Common 1 min read

Q20.How do you handle multiple windows / tabs?

String parent = driver.getWindowHandle();
for (String h : driver.getWindowHandles()) {
  if (!h.equals(parent)) driver.switchTo().window(h);
}
Medium Occasional 1 min read

Q21.How do you perform mouse hover / drag-drop?

new Actions(driver)
  .moveToElement(menu)
  .clickAndHold(item)
  .moveToElement(target)
  .release()
  .perform();
Medium Occasional 1 min read

Q22.How do you use JavaScriptExecutor?

JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].scrollIntoView(true);", element);
js.executeScript("arguments[0].click();", element);

Use sparingly — it bypasses real user behavior.

Confidence check

If you can confidently answer the Frames, Alerts, Windows & Actions questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

5. TestNG, POM & Career

Medium Occasional 1 min read

Q23.What is TestNG and why pair it with Selenium?

TestNG is the runner that gives Selenium tests: annotations (@Test, @BeforeMethod), data-driven support (@DataProvider), parallel execution via testng.xml, listeners, and reports. See our TestNG Q&A.

Easy Occasional 1 min read

Q24.What is the Page Object Model?

A design pattern where each page is a class with locators as fields and user actions as methods. Keeps tests readable and locators in one place — the #1 pattern freshers must know.

Medium Occasional 1 min read

Q25.Show a minimal Page Object.

public class LoginPage {
  private final WebDriver d;
  private final By email = By.id("email");
  private final By pwd   = By.id("password");
  private final By submit = By.id("login");
  public LoginPage(WebDriver d) { this.d = d; }
  public void loginAs(String e, String p) {
    d.findElement(email).sendKeys(e);
    d.findElement(pwd).sendKeys(p);
    d.findElement(submit).click();
  }
}
Medium Occasional 1 min read

Q26.How do you run tests on Chrome in headless mode?

ChromeOptions opts = new ChromeOptions();
opts.addArguments("--headless=new", "--window-size=1280,900");
WebDriver driver = new ChromeDriver(opts);
Easy Occasional 1 min read

Q27.What's new in Selenium 4 that freshers should know?

  • W3C-only protocol
  • Relative locators (above/below/near)
  • Selenium Manager (auto driver download)
  • Chrome DevTools Protocol (CDP) access
  • Better Grid architecture
Confidence check

If you can confidently answer the TestNG, POM & Career questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

Quick revision

  1. Q1: What is Selenium — Selenium is an open-source suite for automating web browsers.
  2. Q2: What are the components of Selenium — Selenium IDE — record-and-playback browser extension Selenium WebDriver — code-first API (the main one) Selenium Grid — distributed / parallel execution
  3. Q3: What is WebDriver — The W3C-standard programming interface for controlling a browser.
  4. Q4: How do you set up Selenium with Java + Maven — &lt;dependency&gt; &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt; &lt;artifactId&gt;selenium-java&lt;/artifactId&gt; &lt;version&gt;4.28.0&lt;/version&gt; &lt;/dependency&g
  5. Q5: Do you still need to download ChromeDriver manually — No — Selenium 4.6+ ships Selenium Manager , which auto-downloads the right driver.

Frequently asked questions

Yes — Selenium still tops the JD frequency chart for entry-level QA roles worldwide. Learn it first, then add Playwright to modernize your CV.

Master 25–30 fundamentals (locators, waits, POM, TestNG basics) — that covers 80% of first-round questions. Then read our 300-Q hub for depth.

Basic understanding (what it is, why parallel matters) is enough. Deep Grid architecture is a mid-level topic.

Java for the most jobs, Python for the fastest learning curve. JavaScript/TypeScript only if targeting Node shops.

Was this article helpful?

Cluster · QA Career

More from QA Interview Questions

Behavioral, framework, coding — full interview prep.

Pillar guide · 10 articles
More in this cluster
From the QA Career pillar

Key takeaways

  • Master the fundamentals before tackling advanced Selenium scenarios.
  • Always explain trade-offs — interviewers reward judgement, not memorisation.
  • Use real project examples; generic answers blend in.
  • Practice answers out loud — written prep doesn't transfer to live rounds.
  • Revise the 30-second cheat sheet the night before your interview.
  • Keep one strong scenario story ready for every section above.

These Questions Are Just the Start

Get 1000+ more with detailed model answers in our QA Interview Preparation Kit. Covers manual testing, automation, API, SQL, Selenium, Playwright, and framework concepts — everything asked in real QA interviews.

Get Interview Kit — ₹1,045

Selenium QA jobs hiring now

Live, indexable Selenium openings — updated daily in Jobs Radar.

Browse all QA jobs on Jobs Radar

Loading current openings…

Home