Interview Selenium
Interview Selenium
Ans. In our Selenium Project we are using Java language. Even though Selenium supports multiple
languages, we are using Java language is just because most of the automation developers have
knowledge on Selenium with Java.
Type of Framework: In our project, we are using Data-driven Framework by using Page Object Model
design pattern with Page Factory.
POM: As per the Page Object Model, we have maintained a class for every web page. Each web page
has a separate class and that class holds the functionality and members of that web page. Separate
classes for every individual test.
We have separate packages for Pages and Tests. All the web page related classes come under Pages
package and all the tests related classes come under Tests package.
Home Page and Login Page,we have a separate classes to store element locators. For the login test
there would be a separate class which calls the methods from the Home Page class and Login Page
class.
As per the maven project, all the tests are kept in the ‘src/test/java‘ and remaining files (such as
config.properties, element locators (POM classes), utility files, test data, etc.,) kept under
‘src/main/java‘.
Test Base class (TestBase.java) deals with all the common functions used by all the pages. This class
is responsible for loading the configurations from properties files, Initializing the WebDriver, Implicit
Waits, Extent Reports and also to create the object of FileInputStream which is responsible for
pointing towards the file from which the data should be read.
Utility Class (AKA Functions Class): Utility class (TestUtil.java) stores and handles the functions (The
code which is repetitive in nature such as waits, actions, capturing screenshots, accessing excels,
sending email etc.,) which can be commonly used across the entire framework. The reason behind
creating utility class is to achieve reusability. This class extends the TestBase class to inherit the
properties of TestBase in TestUtil.
Properties file: This file (config.properties) stores the information that remains static throughout the
framework such as browser specific information, application URL, screenshots path etc.
All the details which change as per the environment and authorization such as URL, Login Credentials
are kept in the config.properties file. Keeping these details in a separate file makes easy to maintain.
Screenshots will be captured and stored in a separate folder and also the screenshots of a failed test
cases will be added in the extent reports.
All the historical test data will be kept in excel sheet (controller.xlsx). By using ‘controller.xlsx’, we
pass test data and handle data driven testing. We use Apache POI to handle excel sheets.
Using Maven for build, execution and dependency purpose. Integrating the TestNG dependency in
POM.xml file and running this POM.xml file using Jenkins.
For the reporting purpose, we are using Extent Reports. It generates beautiful HTML reports. We use
the extent reports for maintaining logs and also to include the screenshots of failed test cases in the
Extent Report.
Or
2. Type of Framework: Behavioral-driven Framework by using Page Object Model design pattern
with page factory
3. POM: As per pom, we have maintained a class for every web page. Each webpage has a seperate
class for functionality and members of that webpage. Seperate classes for every individual test.
4. Packages: We have seperate packages for test case, test data, utilities
5. Test Base class: It will deal with all the common functions used by all the pages. This class is
responsible for loading the configurations from properties file, initializing the Webdriver, Implicit
waits, Extent Reports and also to create the object of FileInputStream which is responsible for
pointing towards the file from which the data should be read.
6. Utility class: It stores and handles the the functions which are repetitive (Waits, actions, capturing
screenshots,accessing excels, Sending mails etc).This class extends the Test Base class to inherit the
properties.
Selenium Page Factory Pattern is like an extension to Page Object Model , but Page Factory is much
enhanced model. To start with, we just need to import package
‘org.openqa.selenium.support.PageFactory’
Factory class can be used to make using Page Objects simpler and easier.
We use Page Factory pattern to initialize web elements which are defined in Page Objects.
We should initialize page objects using initElements() method from PageFactory Class as below,
Once we call initElements() method, all elements will get initialized. PageFactory.initElements() static
method takes the driver instance of the given class and the class type, and returns a Page Object
with its fields fully initialized.
3.Suppose you have 7 pages in your application then to achieve POM what u will do?
Ans. We will create 7 different classes for 7 different pages of the application with Web elements
defined.
Create different feature files with test scenarios related to these page
Create test data file with test data to be used
Or
1. Create 7 class files for each page and define all the objects and methods of that page in each class
respectively
2. Based on the flow reference the methods from page class in the test class file ""
""Have you used interface in your framework other then selenium interfaces?
3. Define all the methods in interface and implement in page clas to hide the implementation.
Xpath is a query language for selecting nodes from an XML document. In selenium Xpath is the most
synatx or way of finding web elements existing on a web page
Syntax - Xpath=//tagname[@attribute='value']
relative - this xpath starts with double slash // which means it can search element anywhere on the
web page. Its the best way of finding an xpath, because in this way we need not to go through each
an every tag to reach a specific web element
//input[@id='twotabsearchtextbox']
absolute - direct way of finding the webelement. One of the huge disadvantage is the if there are
any changes in the future in the code , the xpath may fail.
Eg - /html/body/div[2]/div[1]/div/h4[1]/b/html[1]/body[1]/div[2]/div[1]/div[1]/h4[1]
Ans.
Ans. The Scrum divides the project backlog into small iterations where each iteration makes an
improvement into the product which can be delivered to customer if need be. The iterations are
called sprints, the duration is typically 1–4 weeks. The team which is cross functional tries to make
incremental improvement in the product in each sprint.
Backlog Grooming
Product backlog is a prioritized work items/userstories that are needed to bring the product in to
fruition. It is managed by the product owner in collaboration with Scrum Master and the team.
Backlog of the product is an ever changing list based on the new features, modifications, findings
etc. The aim of grooming is to keep the userstories in a prioritized manner where immediate ones
are also properly estimated and ready for consumption in the sprints.
Sprint Planning
The first ceremony is the sprint planning where the team sits and decide which backlog items. During
this session the product owner who has the customer inputs and release planning gives the team
information on the priority of the backlog items.
Daily Standup
Daily Standup/Daily Scrum is a daily meeting for the team to do a quick check on the status and
resolves issues blocking the team. This is a short meeting where each member of the team answers
the following questions,
• Is there anything blocking my progress which can effect the goal of the sprint.
The scrum master has the role here to make sure that the updates are specific and the meeting does
not diverge into unrelated discussions.
Sprint Review
This meeting is at the end of the sprint where the team along with Product Owner, potentially
customer meets to make sure that the sprint goal is achieved. The team goes through the
demonstration of the product and confirms that the outcome is as the expectation of product owner
and customer
Sprint Retrospective
This is the meeting to analyze the sprint data and see to answer following questions,
In this meeting the team comes up with a plan to correct the mistakes, resolve the team conflicts.
This is an opportunity where team members openly discuss about the problems and corrective
actions that need to be taken in the sub-sequent sprints.
7.Have you used interface in your framework other then selenium interfaces?
Ans I have used selenium interfaces only in my selenium project while initializing any browser using
selenium webdriver.
1. Getting the application under test to be in sync with the testing tool - Selenium
2. How to achieve - Wait concept: Using Implicit wait and explicit wait
Implicit wait
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
9. How u will handle popup window ?other then get window handle?
Yes, We have used Page Object Model design pattern with page factory. As per pom, we have
maintained a class for every web page. Each webpage has a seperate class for functionality and
members of that webpage. Seperate classes for every individual test.
1. Page Factory in Selenium webdriver is an integrated concept of API. Here we follow again the
same principles of keeping repository objects or page classes seperate from test cases.
2. POM and page factory are same design patterns but differs in the way we define the locators
when you are working with page object patterns.
3. Here we use @FindBy annotation to find elements and to initialize webelements using
initelements process.
Suppose you have 7 pages in your application then to achieve POM what u will do?
Yes, We have used Page Object Model design pattern with page factory. As per pom, we have
maintained a class for every web page. Each webpage has a seperate class for functionality and
members of that webpage. Seperate classes for every individual test.
Have you used interface in your framework other then selenium interfaces?
Yes, I have used interface in my project to hide the actual implementation. Like I have created an
interface for user details and implemented it for the login page class and esignature class to use the
data.
Create Connection to DB -> Create Statement Object -> Execute the SQL Query. Store results in
ResultSet
Suppose u have class and abstract class in class there is a user defined constructor and main method
which one will get execute first?
The main method will always execute first because it is a special static method that will be called
from Java itself to start an application.
XML file that contains information about the project and configuration details used by Maven to
build the project.
TestNG. xml file is a configuration file that helps in organizing our tests. It allows testers to create
and handle multiple test classes, define test suites and tests. It makes a tester's job easier by
controlling the execution of tests by putting all the test cases together and run it under one XML file.
A bug life cycle is the journey of bug, basically different stages which a bug goes through during its
life time. It differs from company to company and projects to projects depending upon the software
testing strategies and processes.
Common bug flow can be - Open, Assigned, In Progress, Dev Complete, In Testing, Closed or Reopen
What strategies you followed while building a Selenium framework from scratch?
• Analyzing business requirement in order to determine the test strategy covered by automation
testing
I have done
• Constraints.
• Stored procedures
• The field size defined in the application is matching with that in the DB.
Or
In SQL testing I basically tested various tables and data available in those tables. On an high level the
testing involved entry of correct data when certain request is sent from front end, whether the
intended table has the entry or not.
For example - When a user creates an account, there should be DB entry in a specific table, say
Registered_User with all the details - first name, last name etc
Similarly another example can be - a ecommerce site showing delivery date of a particular product.
This delivery date is fetched from a DB table, which in turn was calculated there. We test these DB
tables, with different SQL queries to evaluate whether the correct response in expected format is
visible or not
nner join- table that has join within itself. Gives the resukt from the same table.
Or
1. Inner Join: Returns only the rows that have matching values in both the tables
2. Outer Join: It includes the matching rows as well as some of the non-matching rows between the
two tables.
Left Outer Join: Returns all the rows from the LEFT table and matching records between both the
tables.
Right Outer Join: Returns all the rows from the RIGHT table and matching records between both the
tables.
Full Outer Join: It combines the result of the Left Outer Join and Right Outer Join.""
Sql query to find out total salary for all employee department wise?
FROM EMPLOYEE
GROUP BY DepartmentID""
"
Explain about the usage of Jira ? How add testcases and defects?
JIRA: This software is like the central hub for the coding, collaboration, and release stages. QA teams
Use Jira for issues, customized screens, fields, and workflows to manage manual and automated
testing.
a) For Agile Teams: -issue tracking, scrum boards, kanban boards, customizable workflows
b) For Project Management Teams:- Issue/Task Management, workflow customization, Reports and
Analytics, User Permission
c) For Software Development Teams:- Release Planning, Sprint Planning, CI/CD Integration, Issue
Management
f) For Task Management:- Email notification, custom fields, task change, sub tasks etc
Adding test cases in JIRA: Refer this link with step by step explanation
(https://blog.testlodge.com/how-to-write-test-cases-in-jira/)
Defect ID
Defect title
Environment information
Screenshot(attachment)
Severity
Assign it to someone
There are seven basic elements of a Selenium test script, which apply to any test case and any
application under test (AUT):
Create a WebDriver instance.
driver.get("https://www.udemy.com");
driver.findElement(By.id("xxxx"))
driver.findElement(By.linkText("xxxx"))
driver.findElement(By.className("xxxx"))
driver.findElement(By.cssSelector("input#email"))
driver.findElement(By.name("xxxx"))
driver.findElement(By.xpath("//html/body/div/tablexxxx"))
driver.findElement(By.partialLinkText("xxxx"))
driver.findElement(By.id("xxxx")).click();
driver.findElement(By.linkText("xxxx")).click();
driver.close();
System.exit(0);
1)What are your roles and responsibilities as manual tester?
4)What is @dataprovider
<suite tag> also what do you mention in double quotes like parallel =" "
Make test cases and test data with user stories or test scenarios.
If the defect is found, then report it to the developer and fix it.
"
"2>Selection or identification of test cases for automation from existing test case documentation.
Organizing, monitoring defect management process Handling changes and conducting regression
tests.
Find solutions for issues related to object identity issues and error handling.
Coordination of the members of the Test team and the development team to solve the issues.
1. Risk in agile
"1. Agile requires Experience, skilled people, requires planning and productivity. Also Agile is time
bound. Budget can go more than planned.
2. Spillover
4. Bug Summary, Description, Steps, Expected and Actual Result, Priority, Severity, Environment
5. BA
6. Team Lead activity of planning and assignment work, Test execution, working on JIRA tickets, issue
resolution , test matrices".
8.tell me 10 test cases for item add to cart for ecommerce application?
11.Exploratory testing?
13.explain severity and priority and High severity with low priority, low severity and high priority?
Software Development Life Cycle (SDLC) is a sequence of different activities performed during the
software development process.
Software Testing Life Cycle (STLC) is a sequence of different activities performed during the software
testing process.
Bug life cycle is also known as Defect life cycle. In Software Development process, the bug has a life
cycle. The bug should go through the life cycle to be closed. Bug life cycle varies depends upon the
tools (QC, JIRA etc.,) used and the process followed in the organization.
Stress testing-
- Stress Testing is performed to test the robustness of the system or software application under
extreme load.
- Stress testing is performed to find the behavior of the system under pressure.
Load Testing-
-Load Testing is performed to test the performance of the system or software application under
extreme load.
- Load testing is performed to find out the upper limit of the system or application.
Defect-
The variation between the actual results and expected results is known as defect.If a developer finds
an issue and corrects it by himself in the development phase then it’s called a defect.
Bug-
If testers find any mismatch in the application/system in testing phase then they call it as Bug
load testing-
o Determine connection speeds. Some users may be connected via leased lines while others
may use dial-up
8. Re-test
stress testing-
1. Plan the Stress Test – In this step, you gather the system data, analyze the system and define
the stress test goals.
2. Create Automation Scripts – Here, you need to create the Stress testing automation scripts and
generate the test data for the stress scenarios.
3. Script Execution – In the third step, you run the Stress testing automation scripts and store the
stress results.
4. Results Analysis – After storing the results, now you need to analyze the Stress Test results and
identify bottlenecks.
5. Tweaking and Optimization – In the final step, you fine-tune the system, change configurations,
and optimize the code to meet the desired benchmark.
When a software testing performed without proper planning and documentation, it is said to be
Adhoc Testing.
11.Exploratory testing?
EXPLORATORY TESTING is a type of software testing where Test cases are not created in advance but
testers check system on the fly. They may note down ideas about what to test before test execution.
The focus of exploratory testing is more on testing as a ""thinking"" activity.
build acceptance testing is a set of tests run on every new build to verify that build is testable before
it is released to test team for further testing.
13.explain severity and priority and High severity with low priority, low severity and high priority?
-severity -The severity is a parameter set by the tester while he opens a defect and is mainly in
control of the tester.
-Priority: It defines the priority in which the defects should be resolved. if there are multiple defects,
the priority decides which defect has to be fixed and verified immediately versus which defect can
be fixed a bit later. It is usually set by the lead
-low severity with a high priority: A logo error for any shipment website, can be of low severity as it
not going to affect the functionality of the website but can be of high priority as you don't want any
further shipment to proceed with the wrong logo.
-high severity with a low priority: Likewise, for flight operating website, a defect in reservation
functionality may be of high severity but can be a low priority as it can be scheduled to release in a
next cycle.
Data-driven testing is creation of test scripts where test data and/or output values are read from
data files instead of using the same hard-coded values each time the test runs. This way, testers can
test how the application handles various inputs effectively.
A test plan contains a product description, objectives, testing strategies, scope, schedule,
procedures, testing resources, and deliverables.
Software Defects/ Bugs are normally classified as per:Severity / Impact ,Probability / Visibility
,Priority / Urgency ,Related Dimension of Quality ,Related Module / Component,Phase
Detected,Phase Injected
AGILE methodology is a practice that promotes continuous iteration of development and testing
throughout the software development lifecycle of the project. In the Agile model, both development
and testing activities are concurrent