Posts

Showing posts with the label Java

Real Time Automation Testing Interview Questions - Part 1 Java

Java Can you tell Oops concepts and relate it with your Framework? We have Polymorphism, Inheritance, Encapsulation and Abstraction in Oops. So, we will start with 1) Abstraction- Data Abstraction means to handle complexity by hiding unnecessary details from the user. In java, abstraction is achieved by interfaces and abstract classes. We can achieve 100% abstraction using interfaces. In Selenium, WebDriver itself acts as an interface. Consider the below statement: WebDriver driver = new ChromeDriver(); We initialize the Chrome Browser using Selenium Webdriver. It means we are creating a reference variable (driver) of the interface (WebDriver) and creating an Object. Here WebDriver is an Interface and ChromeDriver is a class. We can apply Abstraction in a Selenium framework by using the Page Object Model design pattern. We define all our locators and their methods in the page class. We can use these locators in our tests but we cannot see the implementation of their underlying methods.