Description: Selenium is widely used for web automation. Practicing interview questions can help improve both concepts and practical skills.
Q1: What are the different types of locators in Selenium?
A1: ID, Name, ClassName, TagName, LinkText, PartialLinkText, CSS Selector, XPath.
Q2: How do you handle alerts and popups in Selenium?
A2: Use driver.switchTo().alert()
→ then accept, dismiss, or getText from the alert.
Q3: What is the difference between implicit wait and explicit wait?
A3:
-
Implicit wait: Applies globally, waits for elements for a defined time.
-
Explicit wait: Applies condition-based waits for specific elements (e.g. visibility, clickable).