A maintainable framework follows DRY, single-responsibility, stable-locator, and no-hard-wait principles, and avoids anti-patterns like duplicated code, hard-coded data, assertions in page objects, Thread.sleep, brittle XPath, and giant test methods.
Good practices: keep tests small and focused (one behavior), reuse via page objects/utilities (DRY), use stable data-* locators over brittle absolute XPath, centralize waits/config/driver, externalize data, and review test code like production code. Anti-patterns to avoid: Thread.sleep, hard-coded URLs/credentials, copy-pasted logic, assertions inside page objects, order-dependent tests, one giant test doing everything, and over-mocking. Naming, structure, and consistency matter because tests are read and maintained far more than written. Interviewers probe whether you treat test code as first-class, maintainable software.
A code review rejects a PR that hard-codes a URL, uses absolute XPath and Thread.sleep, and asserts inside a page object — the author refactors to ConfigReader, a data-testid locator, an explicit wait, and a test-level assertion, matching framework standards.
List the top anti-patterns you'd flag in a Selenium framework code review and their fixes.