What are the four pillars of OOP, and where do they show up in a test framework?
Encapsulation (bundle data with the methods that guard it), inheritance (a type reuses another's behaviour), polymorphism (one interface, many implementations), abstraction (expose what, hide how).
Encapsulation (bundle data with the methods that guard it), inheritance (a type reuses another's behaviour), polymorphism (one interface, many implementations), abstraction (expose what, hide how).
The interview edge is naming where each lives in automation: a Page Object encapsulates its locators; a BasePage others inherit; a driver interface with Chrome/Firefox implementations is polymorphism; and an abstraction like LoginPage.login() hiding the clicks. Reciting definitions is junior; mapping them to a framework is the SDET answer.
- Encapsulation, Inheritance, Polymorphism, Abstraction
- Page Object = encapsulation; BasePage = inheritance
- Driver interface with browser impls = polymorphism
Encapsulation and abstraction — hiding locators and mechanics behind intent (login(), addToCart()) is what lets a UI change touch one class instead of fifty tests.
Just listing the four words is a junior answer. Interviewers wait for a concrete example of each — ideally from test code, since that's the job.