Where you have applied OOPS concept in your Automation Framework?
Автор: Utkarshaa Academy
Загружено: 2024-07-29
Просмотров: 7912
1) ABSTRACTION
Abstraction is the methodology of hiding the implementation of internal details and showing the functionality to the users.
using Abstract Class and Interface we achieve abstraction in selenium we use WebDriver, JavaScriptExecutor, TakesScreenShot, etc... for achieving abstraction in automation framework.
• Abstraction in Java
2) INHERITANCE
The mechanism in Java by which one class acquires the properties (instance variables) and functionalities of another class is known as Inheritance.
We create a Base Class in the Automation Framework to initialise WebDriver interface, WebDriver waits, Property files, Excels, etc., in the Base Class.
we extend the Base Class in other classes such as Tests and Utility Class.
• Inheritance in java
3) POLYMORPHISM
Polymorphism allows us to perform a task in multiple ways combination of overloading and overriding is known as Polymorphism. We will see both overloading and overriding below.
METHOD OVERLOADING
We use Implicit wait in Selenium. Implicit wait is an example of overloading. In Implicit wait we use different time stamps such as SECONDS, MINUTES, HOURS etc.,
Action class in TestNG is also an example of overloading.
Assert class in TestNG is also an example of overloading.
METHOD OVERRIDING
We use a method which was already implemented in another class by changing its parameters. To understand this you need to understand Overriding in Java.
Declaring a method in child class which is already present in the parent class is called Method Overriding. Examples are get and navigate methods of different drivers in Selenium .
• Polymorphism in Java
4) ENCAPSULATION
Encapsulation is a mechanism of binding code and data (variables) together in a single unit.
All the classes in a framework are an example of Encapsulation. In POM classes, we declare the data members using @FindBy and initialisation of data members will be done using Constructor to utilise those in methods.
What is Page object Model and Page Factory in Selenium?
• What is Page object Model and Page Factory...
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: