interview practice
interview practice
My roles and responsibilities includes understanding the User Stories , writing manual test
cases based on user story ,and perform manual testing and log bugs if found, once developer
has fixed all the bugs for that test case then we mark test case as Done in JIRA , after that we
add labels in test cases that whether the test case is Automation Candidate or not , after that
we start picking test cases that have automation label and automate them using Selenium Java
and push code to github. Also I fix the test scripts in case of failure. Also I attend client calls on
daily basis and understanding their requirements and act accordingly , also I am involved in
Sprint Planning meeting, attending daily 15 min scrum call in morning. I help my team members
in case of any blockers.
Folder 1 (src/test/java)
We have src/test/java folder where we have one package named #testcases and we are
maintaining all our test case files (java files). Ex : LoginTest.java
We are using @Test Annotation for tests.
Folder 2 (src/test/resources)
Inside src/test/resources we have one package with name #utilities where we maintained our
data.properties file containing url and username and password data. Our excel files are also
present inside this utilities package.
Folder 3 (src/main/java)
pajeobjects
In this folder we have one package named #pageobjects where we stored all our locators for
each webpage of our application.
baseTest
In this folder we have one package with name #baseTest
-- inside this we have our base.java file from where we invoke our browsers, we are using the
concept of ThreadLocal class for thread safety so we can run tests in parallel, also we are
extending this base class in every tests. Also we are loading our properties file inside base class.
Also we are using @BeforeSuite (for launching browsers ) and @AfterSuite (for closing browser)
listener
In this Folder we have the #listener package too, inside that we have Listeners.java class that
implements ITestListener interface so we can control flow of execution like taking screenshots
for failed test case and attaching them with extent reports.
#extent reports
#extent reports we are using. We kept extent.properties file in src/test/resources folder
hashtag#testng.xml: This file we have maintained to run multiple tests also this file is properly
configured in our pom.xml file using Maven Surefire Plugin so we can easily run our testng.xml
from maven command.
Note : Memorize how testng.xml file looks sometimes interviewer can ask you to write sample
testng.xml file on notepad.
Jenkins usage:
**#Our Project is configured in jenkins we have provided our pom.xml path in jenkins and using
mvn clean test command to run our test cases.
We are using testng framework along with Data Driven Approach. This is how we have used
OOPS concept in our framework.
Inheritance
We have a BaseTest.java class that contains a method, void setupDiver() with annotation
@BeforeMethod which is responsible for setting up a WebDriver instance and passing that
driver object to ThreadLocal . This base class is extended by all of our test classes under the
src/test/java folder. By doing this, we are able to reuse the public void setupDriver() method in
each test class, leveraging Inheritance to avoid code duplication. This will make sure that the
driver setup logic is centralized and can be easily maintained across all test classes.
Encapsulation
In our BaseTest.java class we have made one variable :
private static ThreadLocal<WebDriver> driver = new ThreadLocal<>();
we made it private and to access driver object in other places we have created below getter
method.
Polymorphism
#Method Overloading
In our Website we have frames at many places so we created method with same name and
different parameter data types. So achieved overloading.
#Method Overriding
In our BaseTest.java
Abstraction
We have one Interface "UserAction" with Abstract method : performAction()
Implementations Classes for UserAction Interface are below 👇
Our one of TestCases uses "UserAction" interface and calls performAction() method. It doesn't
need to know which specific action is being executed.