QA Automation interviews test framework knowledge, automation patterns, and — most of all — whether you can write tests that stay green for reasons other than luck. Below are common questions with model answers. Junior: core theory, definitions, and simple practical cases.
1
What is the difference between an explicit and an implicit wait, and what breaks when you mix them?
Answer
An implicit wait is a global setting that makes every element lookup retry for up to N seconds. An explicit wait targets one condition on one element — clickable, visible, present. Mixing them is the classic mistake: the two timeouts compound unpredictably, and a lookup you expected to fail fast can hang for the sum of both. Set the implicit wait to zero and use explicit waits everywhere.
2
Why is Thread.sleep considered bad practice in tests?
Answer
Because it encodes a guess. Sleep three seconds and you either waited too long on every run, adding minutes across a suite, or not long enough on a slow day, which is exactly how a test becomes flaky. An explicit wait polls for the condition and continues the moment it is true, so it is both faster and more reliable. Sleep is only defensible when there is genuinely nothing observable to wait for.
3
CSS selector or XPath — what do you pick and why?
Answer
CSS is faster, more readable and enough for most cases. XPath earns its place when you need to traverse upward to a parent, select by visible text, or use an axis — things CSS cannot express. What matters more than the choice is stability: a selector tied to a data-testid survives a redesign, and one copied from devtools with six nested divs does not.
4
What is the Page Object Model and what problem does it solve?
Answer
It puts the locators and actions for a screen in one class, so the test says login.submit(admin) rather than listing element lookups. The problem it solves is duplication: when a button changes, one file changes instead of forty tests. The failure mode is putting assertions inside the page object — the page describes the screen, the test decides what is correct.
5
What is the difference between an interface and an abstract class?
Answer
An abstract class can hold state and a constructor and describes what something is; a class can extend only one. An interface describes what something can do and a class can implement many. In a test framework this shows up immediately: a base page with a shared driver field is an abstract class, and something like Searchable that several pages support is an interface.
6
Why do flaky tests happen?
Answer
Almost always timing or shared state. Timing means asserting before the application finished — an animation, an async request, a re-render. Shared state means one test leaving data another depends on, which shows up the moment you run them in a different order or in parallel. The third and least discussed cause is the environment: a slow CI machine turns a race you never noticed locally into a daily failure.
7
What is a StaleElementReferenceException and how do you avoid it?
Answer
It means you kept a reference to an element that the page has since re-rendered — the object points at a node no longer in the DOM. It appears most often after an update that redraws a list or a table. You avoid it by looking the element up again rather than storing it, which is exactly what Playwright locators do by design and what a Selenium PageFactory field does not.
🦎
Reading answers is not enough
In a real interview you speak under pressure. Cam asks these same questions, scores every answer, and shows exactly what to fix.
Practice a Junior QA Automation interview →Free · 3 interviews per month