Description:
Selenium is widely used for automation testing. Here are some commonly asked interview questions:
1. What is the difference between findElement() and findElements() in Selenium?
👉 findElement() returns a single WebElement, while findElements() returns a list of WebElements.
2. How to handle multiple windows in Selenium?
👉 Use getWindowHandles() to switch between browser windows.
Description:
Here are some commonly asked Selenium interview questions with short answers:
1. What is the difference between findElement() and findElements()?
findElement() → returns the first matching WebElement.
findElements() → returns a list of matching WebElements.
2. How to handle multiple browser windows?
Use getWindowHandles() and switchTo().window(handle) to switch.
3. What are different types of waits in Selenium?
Implicit Wait
Explicit Wait
Fluent Wait
4. How to handle alerts/pop-ups?
Alert alert = driver.switchTo().alert();
alert.accept(); // To click OK
5. What is Page Object Model (POM)?
A design pattern where each page of the application has a separate class containing elements and actions.