Part 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Automation Testing Real

Time Interview Questions


With answers

By : Jaikishan Mohanty
1. Can you brief me about yourself?
Hi, my name is Pankaj. I started my career as a Testing Executive 4.5 years back with Infosys currently I am
working as Test Engineer.

My responsibility is to understand Business Requirement Specification and High-Level scenarios and to


convert them into test cases & Automation scripts if required. Execution of test cases and reporting of defect to
the developer if there any and get them fixed. I have experience on Functional, Automation, Regression,
Smoke, Sanity, Web accessibility, Web Analytics, Mobile Testing.

In my previous project I have worked on Automation testing where we have used Selenium with java and
TestNG Cucumber framework for BDD approach. We have used Page object model where we have separated
our test cases with page objects, and we performed testing on the same. For build management tool we are
using Maven for version controlling we are using Git and for automating our jobs for nightly run or any schedule
we are using Jenkins,.

For defect management & test case management we have used JIRA, TEST RAIL & HP ALM. I have worked
on tools like BrowseStack, DeviceAnywhere, Toadsql,

I am working on Agile environment we have daily standup call and we have 2-week sprint cycle. I am part of
8-member team out of which we are 3-Tester, 2- dev, 1- manager, 1-scrum master
2. Tell me your Day to Day activities as QA?
First thing I do after login in my system. I check the active
sprint in Jira for our project code. There I can see my
assigned open tasks. After that I will check my mail if there is
any important mail I need to take action on. Then we have our
daily scrum meeting where we used to tell our previous day
actions what we did, what we are planning for today and if we
have any blocker to discuss. Product owner and scrum master
help us to resolve that blocker. After that I need to take the
pending task and do needed action whether creating test
case, Execution, Defect retesting if any.
3. Do you have created framework from scratch, or
you have maintained that?
I have not created Framework from scratch by
myself but yes, I was part of framework creation and
created some part of it.
4. How much you rate yourself in Java out of 10?

Out of 10 I will rate myself 6 in java as QA


Automation engineer.
5. Can you tell me Oops concepts and relate it with
your Framework?
We have Polymorphism, Inheritance, Encapsulation and Abstraction in Oops. So, we will start with

1) DATA 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 Data 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. So we only show the locators in the tests but hide the implementation. This is a simple example of how we can use Data
Abstraction in our Automation Framework.
2) ENCAPSULATION : Encapsulation is defined as the wrapping up of data
under a single unit. It is the mechanism that binds together code and the
data it manipulates. Encapsulation can be achieved by: Declaring all the
variables in the class as private and writing public methods in the class to
set and get the values of variables. All the classes in an Automation
Framework are an example of Encapsulation. In Page Object Model
classes, we declare the data members using @FindBy and initialization of
data members will be done using Constructor to utilize those in methods.
3) INHERITANCE Inheritance is the mechanism in java by which one class
is allowed to inherit the features (fields and methods) of another class. We
can apply Inheritance in our Automation Framework by creating a Base
Class to initialize the WebDriver interface, browsers, waits, reports, logging,
etc. and then we can extend this Base Class and its methods in other
classes like Tests or Utilities. This is a simple example of how we can apply
Inheritance in our framework.
4) POLYMORPHISM Polymorphism allows us to perform a single action in different
ways. In Java polymorphism can be achieved by two ways: –
Method Overloading: When there are multiple methods with same name but different
parameters then these methods are said to be overloaded. Methods can be
overloaded by change in number of arguments or/and change in type of arguments.
In Selenium Automation, Implicit wait is an example of Method Overloading. In
Implicit wait we use different time stamps such as SECONDS, MINUTES, HOURS
etc. –
Method Overriding: It occurs when a derived class has a definition for one of the
member functions of the base class. That base function is said to be overridden. In
Selenium Automation, Method Overriding can be achieved by overriding any
WebDriver method. For example, we can override the findElement method In
assertion we have used overload because in assertion we used to like
asset.true(actual, expected) and second time we can use same assert.true(actual,
expected, message).
6. How can you use interface and how it is different
from Abstract class?
Abstract class may have Abstract and concrete
methods, and there is not any compulsion in adding
abstract method in abstract class. But in Interface,
we do have only abstract methods and we don’t
need to write abstract keyword in Interface this is by
default public and abstract.
7. What do you mean by Static keyword in Java?

Static means it is at class level not at instance level,


we have static method, static variable & static inner
class. When we have any variable as static so it will
remain same for all the instance of our classes, and
static/Private/Final methods can’t be over-ridden like
if we have initialized any method as Static so we
cannot override it in any child class.
8. How to call static method and variable in java?

Direct calling, Calling by class name.


9. Can I access Static method by using object
reference?
Yes we can, but we got one warning that you need to
access it via Direct or By class name.
10. How to call non-static method and variable in
java?
For calling non static method we need to create
object first.

You might also like