Quick revision
The short answer
We standardize the parts that are the same for everyone and expensive to get right: driver setup and versions, the browser matrix, wait helpers, reporting with screenshots, video and logs, CI integration and test data APIs, plus shared component objects for the design system and conventions for page objects. We leave page-level objects and test scenarios to each team. The framework ships as a versioned library with a sample project and migration guide, it does not hide Selenium, it is owned by a platform team with a contribution model, and we judge it by flake rate, suite duration and time to diagnose failures.
What to remember
In this answer, we designed a shared UI test framework by standardizing infrastructure, driver setup and versions, the browser matrix, waits, reporting, CI integration, test data APIs and design system component objects, while leaving page objects and scenarios to teams with conventions. We shipped it as a versioned library with a sample project and migration guide, kept Selenium visible instead of hiding it, gave it a platform team with a contribution model, and measured adoption, flake rate, duration and diagnosis time.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
We standardize the parts that are the same for everyone and expensive to get right: driver setup and versions, the browser matrix, wait helpers, reporting with screenshots, video and logs, CI integration and test data APIs, plus shared component objects for the design system and conventions for page objects. We leave page-level objects and test scenarios to each team. The framework ships as a versioned library with a sample project and migration guide, it does not hide Selenium, it is owned by a platform team with a contribution model, and we judge it by flake rate, suite duration and time to diagnose failures.
Background to this question
Five teams with five frameworks means five ways of starting browsers, five reporting formats and five sets of the same bugs, and nobody can move between teams or share a fix. A leader asked to unify them has to decide what to take away from teams and what to leave, because taking too little changes nothing and taking too much produces a framework nobody wants to use. In this answer, we will look at the line between standard and team-owned, the shape of the library, why it should not hide Selenium, how it is owned, and how we measure whether it works.
1Where to Draw the Line
The guiding rule is to standardize what is infrastructure and leave what is domain. Infrastructure is the same for every team and hard to get right: how browsers start, which versions run, how waits work, what gets captured when a test fails, how tests plug into CI. Domain is specific to each product: what its pages look like and which journeys matter.
Standardizing infrastructure gives everyone the best version of something they all need. Standardizing domain would force one team's view of the product onto the others and slow them down, so we leave it alone, with conventions rather than rules.
| Area | Who owns it | Why |
|---|---|---|
| Driver setup, versions, browser matrix | Framework | Same for everyone, easy to get wrong |
| Wait helpers and base layer | Framework | One correct implementation, shared fixes |
| Reporting: screenshots, video, logs | Framework | Comparable results across teams |
| CI integration and Grid access | Framework | One pipeline template, one infrastructure |
| Test data APIs and builders core | Framework | Common auth, cleanup, unique data |
| Design system component objects | Framework | Components are shared across products |
| Page objects | Teams, with conventions | Specific to each product |
| Test scenarios and coverage | Teams | Teams know their critical journeys |
2What Goes Into the Standard
Driver setup means one factory that creates local or remote drivers from configuration, with Selenium Manager or pinned container images handling versions, so no team ever debugs a ChromeDriver mismatch alone. The browser matrix, for example Chrome on every commit and Firefox, Edge and Safari nightly, is defined once.
Wait helpers and the base layer implement explicit waits on application states, such as the loading indicator, once and correctly. Reporting captures a screenshot, page source, console log and video on every failure, in the same format, so a failure in any team looks the same in the dashboard. CI integration is a pipeline template that runs the tests against the shared Grid or vendor and publishes results. Test data APIs give teams a standard way to create users and data through APIs with unique values and cleanup.
We also provide shared component objects for the design system, because those components are used by all five products, and a short guide to page object conventions: intentions not actions, private locators, no assertions, return the next page.
3Shipping It as a Versioned Library
The framework is a normal Java library, published to the internal Maven repository with semantic versions. Teams add it as a test dependency and upgrade when they choose, so a framework release cannot break five suites at once. Breaking changes come with a major version and a migration note.
Next to the library we ship a sample project that shows a complete, working test against a demo page, the recommended project layout, and the CI template. New teams copy the sample; existing teams follow a migration guide that explains how to move piece by piece.
4Why the Framework Should Not Hide Selenium
A common mistake is to build a framework that wraps every Selenium call in its own API, so tests call framework.clickOn("Save") and never see a WebDriver. It looks clean, but it fails in three ways. Every Selenium feature the framework did not wrap becomes unavailable, so teams wait for the platform team. People cannot use the huge amount of Selenium knowledge, documentation and answers that exist publicly. And debugging becomes harder, because an error passes through layers of custom code.
So the framework gives teams a configured WebDriver and helpers around it, and lets them use Selenium directly when they need to. Helpers are a convenience, not a wall.
5Ownership and Contribution
A shared framework without an owner decays. So a small platform team, often two or three engineers, owns it: releases, the CI template, the Grid or vendor integration, and support. But they cannot know every product's needs, so there is a contribution model: teams can propose and submit new component objects or helpers through pull requests, with review by the platform team, a contribution guide, and tests in the framework's own suite.
This keeps the platform team from becoming a bottleneck and gives product teams a sense of ownership, which is what makes them adopt the framework willingly.
6Measuring Adoption and Outcomes
We measure two kinds of things. Adoption: how many teams and suites are on the framework and on a recent version. Outcomes: flake rate per suite, suite duration, and the time it takes to diagnose a failure, which better reporting should cut sharply. If after two quarters flake rate and diagnosis time have not improved for adopting teams, the framework is not doing its job and we need to know why.
These numbers also make the case to leadership for the platform team's cost, and show which teams need help migrating.
7Follow-up questions
How would you migrate the existing suites?
Incrementally and team by team, never as a big-bang rewrite. First, each team switches to the framework's driver factory and reporting, which is a small change and gives immediate value in failure diagnosis. Then they adopt the wait helpers and the design system component objects, replacing their own versions as they touch tests. Their existing page objects and tests keep working throughout. We pick the team most eager to adopt as the first one, fix what they find, and use their results to convince the others. Each step is measured, so we can show that flake rate and diagnosis time improved.
What if a team refuses to adopt it?
I would first find out why, because the reason often reveals a real gap, such as a browser they need that the framework does not support. If the framework solves their problems better than their own code, the numbers will show it; if it does not, we should improve it rather than force it.
Should the framework include its own test runner or DSL?
No. Using JUnit 5 with an extension keeps tests familiar and works with every IDE and CI tool. A custom runner or language adds learning cost and lock-in for little benefit.
8Conclusion
In this answer, we designed a shared UI test framework by standardizing infrastructure, driver setup and versions, the browser matrix, waits, reporting, CI integration, test data APIs and design system component objects, while leaving page objects and scenarios to teams with conventions. We shipped it as a versioned library with a sample project and migration guide, kept Selenium visible instead of hiding it, gave it a platform team with a contribution model, and measured adoption, flake rate, duration and diagnosis time.
Open with
My rule would be to standardize infrastructure and leave the domain to teams. Infrastructure is what every team needs and finds hard: driver creation and browser versions, the browser matrix, explicit wait helpers and a base layer, reporting with screenshots, video, console logs and page source on every failure, the CI pipeline template and Grid or vendor access, and a test data API for creating unique users and data.
Then, if they want more
I would also provide component objects for the shared design system and a short set of page object conventions. Teams keep their own page objects and decide their scenarios and coverage, because they know their product.
I would ship the framework as a versioned Maven library that teams upgrade on their own schedule, with a JUnit 5 extension that injects a configured driver and test data, a sample project showing the recommended layout, and a migration guide.
I would deliberately not hide Selenium behind a custom API, because that blocks features, wastes public knowledge and makes debugging harder; teams get a real WebDriver plus helpers. A small platform team owns releases and support, with a contribution model so product teams can add components through reviewed pull requests.
And I would measure adoption and outcomes: flake rate, suite duration and time to diagnose a failure, and adjust if they do not improve. For existing suites I would migrate incrementally: driver factory and reporting first, then waits and component objects, with no big-bang rewrite.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- JUnit 5
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- JUnit user guide, Mockito documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Five product teams each built their own Selenium framework with different page object...": https://scrivio-interview-library.netlify.app/java/ui-testing/7c7c6a85b5/