Skip to content

Selenium Interview Questions for Automation Testing

7 Selenium questions with answers for automation testing roles. Tick what you have solved to track your progress.

Sheet progressStart practicing
01

Implicit vs explicit vs fluent wait?

Show answer
Implicit wait applies globally to element lookups. Explicit wait waits for a specific condition (WebDriverWait + ExpectedConditions). Fluent wait is an explicit wait with custom polling and ignored exceptions.
02

How do you handle StaleElementReferenceException?

Show answer
Re-locate the element after the DOM refreshes, use explicit waits for the refreshed element, don't keep element references for long, or wrap the action in retry logic.
04

How do you handle a dropdown that is not a <select> tag?

Show answer
Click to open the dropdown, then locate the option by its text, e.g. //li[text()='India'], and click it. Add an explicit wait for the animation.
05

findElement vs findElements?

Show answer
findElement returns the first match and throws NoSuchElementException if nothing is found. findElements returns a List (empty if nothing is found) — handy to check whether an element exists.
06

How do you handle multiple windows?

Show answer
String parent = driver.getWindowHandle(); for (String h : driver.getWindowHandles()) if (!h.equals(parent)) driver.switchTo().window(h); // ...then switch back to parent
07

How do you upload a file with Selenium?

Show answer
If the element is <input type="file">, use element.sendKeys("C:/path/file.pdf"). Use the Robot class or AutoIt only as a last resort for OS dialogs.