Scrivio Interview library

Browser UI testing with Selenium

16 questions in 5 subtopics.

WebDriver setup and versions

ConceptFoundations7 min read
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.
DebuggingIntermediate7 min read
Your Selenium suite suddenly fails on CI with SessionNotCreatedException: 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.
LeadershipPrincipal7 min read
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

CodingFoundations7 min read
A test clicks a 'Save' button that becomes enabled only after an async validation, and it fails randomly with ElementClickInterceptedException or NoSuchElementException. Rewrite the step with Selenium explicit waits and say which locator you would use.
DebuggingFoundations7 min read
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.
ScenarioIntermediate7 min read
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?
LeadershipPrincipal7 min read
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

CodingFoundations7 min read
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?
DesignIntermediate6 min read
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?
DesignAdvanced6 min read
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

CodingIntermediate7 min read
Run a JUnit 5 Selenium suite in parallel against Selenium Grid 4. Show how the tests create a RemoteWebDriver, how JUnit parallelism is enabled, and how you keep tests from sharing a browser.
ScenarioAdvanced7 min read
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?
LeadershipPrincipal6 min read
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

CodingFoundations6 min read
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.
ConceptIntermediate7 min read
Compare Selenium WebDriver and Playwright for Java for a new Spring Boot web application's UI tests. Cover waiting model, browser support, isolation, debugging tools and ecosystem.
ScenarioAdvanced6 min read
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?