A single person is behaving differently at different time. We behave differently in front of elders, and friends.In java, we use method overloading and method overriding to achieve polymorphism. Polymorphism means ability to take more than one form that an operation can exhibit different behavior at different instance depend upon the data passed in the operation. So in the class Vishal we are declaring the object of class LatestAddress and then assign new variables using the properties of the previous base classes… So this is a nice example of inheritance… In the LatestAddress class we have total 6 properties.3 are inherited from Address class and 3 properties are In the above Example class LatestAddress getting all features from the Address class. Inheritance: Deriving a new class from the existing class, is called Inheritance.ĭerived (sub class) class is getting all the features from Existing (super class\base class) class and also incorporating some new features to the sub class. It provides code reusability. In real time we are using Encapsulation for security purpose…Įncapsulation = Abstraction Data Hiding. Java bean is the fully encapsulated class because all the data members are private here. So, here multiple parts of cars encapsulate itself together to form a single object that is Car.Ī java class is the example of encapsulation. Which binds together to form a single object that is car. It just Opens….that is essential User doesn’t know internal actions …that is non-essential things…Įncapsulation : Encapsulation means which binds the data and code (or) writing operations and methods in single unit (class).Ī car is having multiple parts. Know what are the actions performed internally…. It will show Compose, Inbox, Outbox, sent mails…so and so when you click on compose it will open…but user doesn’t When you provide the user name and password and click on submit button. In java, we use abstract class and interface to achieve abstraction. OOPs (Object Oriented Programming System): –Ībstraction : Abstraction means showing essential features and hiding non-essential features to the user. It can be physical and logical.Ĭlass :Collection of objects is called class. For example chair, pen, table, keyboard, bike etc. Object: Any entity that has state and behavior is known as an object. So object oriented technique offers better and easy way to write program then procedural programming model such as C, ALGOL, PASCAL. It uses real-world approach to solving a problem. OOPS is a programming approach which provides solution to problems with the help of algorithms based on real world. Java is also known as a strong Object oriented programming language(oops). Using interfaces, we can achieve 100% abstraction.Since Java is an object-oriented language, complete java language is built on classes and object. In Java, abstraction is achieved by interfaces and abstract classes. Then we utilise these locators and methods in tests but we can’t see the implementation of the methods. In Page Object Model design pattern, we write locators (such as Id, Name, Xpath, etc. ABSTRACTIONĪbstraction is a methodology of hiding the implementation and displaying the functionality to end users. This knowledge will not only help you answer interview questions but also enable you to design and implement robust Automation Frameworks in your professional projects. We will explore examples and scenarios where each OOPs concept is applied to enhance the effectiveness and efficiency of an Automation Framework.īy understanding how OOPs concepts are utilised in an Automation Framework, you can demonstrate your proficiency in applying object-oriented principles to create well-structured and scalable test automation solutions. These concepts allow for modular code organisation, code reuse, flexibility, and maintainability. OOPs concepts, such as encapsulation, inheritance, polymorphism, and abstraction, play a crucial role in designing and implementing an Automation Framework. By understanding and applying OOPs principles effectively, we can design a robust and maintainable Automation Framework that leverages the advantages of object-oriented programming. The Automation Framework refers to the structural and functional architecture that is built to support automated testing. In this article, we will explore and elaborate on how and where we have applied various OOPs concepts in an Automation Framework. Before delving into the specifics of applying OOPs concepts in an Automation Framework, it is essential to have a solid understanding of OOPs concepts in Java. In many Selenium interviews, you may come across a common question: " Where have you applied OOPs (Object-Oriented Programming) concepts in an Automation Framework? " This question aims to assess your understanding and practical implementation of OOPs principles in the context of test automation.
0 Comments
Leave a Reply. |