Selenium WebDriver Fundamentals Questions
Core Selenium knowledge: finding elements (locators: ID, class, XPath, CSS selectors), browser automation basics, navigating pages, interacting with elements (click, type, submit), handling alerts, switching windows/frames, and basic waits (implicit, explicit). Understand the difference between Selenium 3 and 4 if relevant. Know common issues: stale element references, element not visible, and basic troubleshooting.
MediumTechnical
35 practiced
Design a Page Object Model (POM) class for a login page in Java using Selenium. Include: private locators, a constructor that accepts WebDriver, methods login(username,password) that returns the next page object, isErrorVisible() returning boolean, and waitUntilLoaded() using explicit waits. Show method signatures and brief implementation notes for waits and element interactions.
EasyTechnical
32 practiced
Explain what Selenium WebDriver is and its role in a Test Automation Engineer's workflow. Include differences between WebDriver and Selenium IDE, and list typical responsibilities WebDriver supports (programmatic browser control, element locating and interaction, retrieving browser logs, executing JS, and integrating automated tests into CI/CD). Describe one scenario where Selenium is the preferred tool and one where another approach (API tests, contract tests, or headless browser alternatives) might be better.
MediumTechnical
32 practiced
Implement a utility function in Python that accepts a Selenium WebDriver instance and a locator tuple (By, selector), waits up to a configurable timeout for the element to be clickable using an explicit wait, clicks it, and raises a clear exception on timeout. Include handling for TimeoutException and an optional retry for StaleElementReferenceException.
HardTechnical
44 practiced
Third-party widgets and cross-origin iframes often appear in web apps and can be hard to test. Explain Selenium's limitations with cross-origin frames (same-origin policy), recommended strategies (mock or stub third-party behavior, perform contract/integration tests with partners, isolate widget tests), and how to validate integration points without direct DOM access (events, network assertions, or server-side logs).
EasyTechnical
39 practiced
Explain what a StaleElementReferenceException (stale element) is in Selenium WebDriver. Describe at least three root causes (DOM refresh, element re-rendered, navigation), and provide short code strategies to avoid or recover from stale elements in test code (re-locate element, use explicit waits, wrap actions in retry loops).
Unlock Full Question Bank
Get access to hundreds of Selenium WebDriver Fundamentals interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.