Browser UI testing with Selenium
16 questions in 5 subtopics.
WebDriver setup and versions
How do you start a Chrome browser from a Selenium 4 Java test today? Explain what Selenium Manager does, how driver and browser versions are matched, and how you run headless on CI.Your Selenium suite suddenly fails on CI withSessionNotCreatedException: This version of ChromeDriver only supports Chrome version N, Current browser version is N+1. Nothing changed in the repository. Explain the cause and make the setup robust.Browser automation moved from vendor-specific drivers and Selenium RC to the W3C WebDriver standard, and now to WebDriver BiDi, while tools like Playwright use their own protocols. As the senior technical leader, what does this evolution mean for your long-term investment in UI test automation?Locators and waits
A test clicks a 'Save' button that becomes enabled only after an async validation, and it fails randomly withElementClickInterceptedException or NoSuchElementException. Rewrite the step with Selenium explicit waits and say which locator you would use.A test finds a row in a table, the page re-renders after a filter is applied, and the next call row.click() throws StaleElementReferenceException. Explain why and how to write the step correctly.A 900-test Selenium suite has a 7 percent flaky failure rate and the team reruns failed tests three times. How do you bring flakiness down, and what do you change in locators, waits and process?UI test suites across your company break whenever front-end teams refactor markup, and test engineers spend most of their time repairing locators. As the senior technical leader, how would you make testability a product engineering standard rather than a test team problem?Page object model
Write a page object for a login page with username, password and a submit button, and a test that uses it. What should and should not be in the page object?Your web application has a design system with reusable components (date picker, data grid, modal) used on 60 pages. How would you structure page objects and test helpers so a component change does not break hundreds of tests?Five product teams each built their own Selenium framework with different page object styles, reporting and drivers. Design a shared UI test framework and say what you would standardize and what you would leave to teams.Selenium Grid and parallel runs
Run a JUnit 5 Selenium suite in parallel against Selenium Grid 4. Show how the tests create aRemoteWebDriver, how JUnit parallelism is enabled, and how you keep tests from sharing a browser.UI test runs take 3 hours and the company pays a cloud browser vendor heavily, while another team proposes self-hosting Selenium Grid on Kubernetes. How do you decide, and how do you cut the run time?Your company spends a large budget on browser test infrastructure across many products, and quality incidents still reach production. As the senior technical leader, how do you set strategy for UI testing investment?Selenium vs Playwright for Java
Write a Playwright for Java test that opens a login page, fills the form, and asserts that the dashboard heading appears. Point out where Playwright waits automatically compared with Selenium.Compare SeleniumWebDriver and Playwright for Java for a new Spring Boot web application's UI tests. Cover waiting model, browser support, isolation, debugging tools and ecosystem.A team proposes migrating 1,500 Selenium tests to Playwright for Java because Playwright tests are faster and less flaky in their pilot. As the architecture lead, how do you evaluate and plan this?No question matches these choices.