We are using the Java Oops concept in your Automation Framework as below
Inheritance: Test classes extending Base Class
Base class:
launchBrowser()
getTimeStamp()
quitBrowser()
Polymorphism: many forms
Example:
POI API -getCellData(Overloading) – Data driven Testing.
getCellData(String sheetname, String colname, int rowName){
}
getCellData(String sheetname, int colname, int rowName){
}
Encapsulation:
Privitating the WebElements in page Classes as part of protection.
declare WebElement as private and method as public so we can access it but directly you can’t access the
WebElement.
We are not allowing the webElement to directly access it outside the class it is a protection mechanism.
Abstraction:
Implementation of methods in Page classes as part of hiding complex details.
Hiding the details.
pageObject:
loginPage
public void enterEmailAddress(String emailAddress){
emailAddressTextfield.sendKeys.(emailAddress);
}
testClass:
loginPage.enterEmailAddress(prop.getProperty(“validEmailAddess”));
Interface:
WebDriver driver = new ChromeDriver();
Here WebDriver is the interface.
the interface has only the abstract method.