Your team's UI test suite has become slow, flaky, and a nightmare to maintain — a small UI change breaks dozens of tests. As a senior engineer, how do you reason about what's structurally wrong with the framework and how to fix it?

technical-conceptual · Senior level · software-engineering

What the interviewer is really asking

Assesses whether the candidate understands the structural causes of brittle UI suites — fragile locators, duplicated selectors, implicit timing waits — and modern framework design (stable locators, abstraction layers, auto-waiting tools) to fix maintainability and flakiness at the root.

What to say

What to avoid

Example answers

Strong: I'd find the structural causes before touching individual tests. 'One change breaks dozens' almost always means brittle locators — deep CSS or XPath bound to the DOM shape — duplicated across tests, so I'd move to stable, intent-based locators like test ids, roles, and accessible names, and centralize element access behind an abstraction so a UI change updates one place, not fifty. For component-heavy UIs that's component objects or app-action helpers rather than giant page-object god classes. The flakiness usually comes from fixed sleeps or racing the UI, so I'd adopt a framework with real auto-waiting and web-first assertions like Playwright instead of manual waits, and treat each flaky test as a bug to root-cause with trace tooling, not something to re-run until it's green.

Weak: I'd add some waits to fix the flakiness and set the CI to retry failed tests a couple of times so they pass. For the maintenance, I'd ask the team to be more careful updating the selectors when the UI changes.

Want questions matched to your role? Paste a job title, job description, or CV and get a personalized set, or go Pro to unlock the full bank.