Professional Documents
Culture Documents
Advantages:
Very simple to plan and manage. Projects where requirements are clearly defined and
stated beforehand can be easily tested.
Disadvantages:
1. Next phase will be beginned only when the previous phase is completed. Hence
this model cannot accomodate unplanned events.
2. This method is not suitable for projects where the requirements change
frequently.
In this model, a big project is divided into small parts and each part is subjected
to different iterations. At the end of iteration
a new module is developed or an existing model is enhanced. This module is
integrated in the software architecture and the entire
system is tested all together.
Once the module is subjected to software architecture the entire system will be
tested. Feedback from testing team is immediately available
and is incorporated in next cycle.
Advantages:
Feedback from testing team is immediately available at the end of each iteration.
Any new changes will be immediately incorporated in the next cycle.
In this process, a big project is divided into small parts and each part is
subjected to different iterations. At the end of iteration
a new module is developed or an existing model is enhanced. This module is
integrated in the software architecture and the entire
system is tested all together.
Once the module is subjected to software architecture the entire system will be
tested. Feedback from testing team is immediately available
and is incorporated in next cycle.
Scrum Practices:
1. Sprint planning
2. Sprint
3. Daily scrum meet
4. Sprint review meeting
5. Sprint retrospective meet
As part of Scrum type, We will be having daily scrum meet to discuss about the
things that should be performed for that day.
Sprint review meeting where will discuss about the product that is developed as
expected.
Sprint retrospective meet to check what went well, what went wrong and areas to be
improved.
Software Testing Life Cycle (STLC) is the testing process which is executed in
systematic and planned manner. In
STLC process, different activities are carried out to improve the quality of the
product. Let's quickly see what
all stages are involved in typical Software Testing Life Cycle (STLC).
Software Testing Life Cycle (STLC) identifies what test activities to carry out and
when to accomplish
those test activities.
The different phases of Software Testing Life Cycle are:
a) Requirement Analysis: During this phase, test team studies and analyzes the
requirements from a testing perspective.
This phase helps to identify whether the requirements are testable or not. If any
requirement is not testable, test
team can communicate with various stakeholders (Client, Business Analyst, Technical
Leads, System Architects etc) during
this phase so that the mitigation strategy can be planned.
b) Test Planning: Test planning is the first step of the testing process. In this
phase typically Test Manager/Test Lead
involves determining the effort and cost estimates for the entire project.
Preparation of Test Plan will be done based
on the requirement analysis. Activities like resource planning, determining roles
and responsibilities, tool
selection (if automation), training requirement etc.,
c) Test Design: Test team starts with test cases development activity here in this
phase. Test team prepares test cases,
test scripts (if automation) and test data. Once the test cases are ready then
these test cases are reviewed by peer
members or team lead. Also, test team prepares the Requirement Traceability Matrix
(RTM). RTM traces the requirements
to the test cases that are needed to verify whether the requirements are
fulfilled. The deliverables of this phase are
Test Cases, Test Scripts, Test Data, Requirements Traceability Matrix
d) Test Environment Setup: Development team or customer provides the test
environment. Meanwhile, test team should
prepare the smoke test cases to check the readiness of the given test environment.
e) Test Execution: Test team starts executing the test cases based on the planned
test cases. If a test case result is
Pass/Fail then the same should be updated in the test cases. Defect report should
be prepared for failed test cases
and should be reported to the Development Team through bug tracking tool (eg.,
Quality Center) for fixing the defects.
Defect life cycle: The different states of a bug in the bug life cycle are as
follows:
New: When a tester finds a new defect. He should provide a proper Defect document
to the Development team to reproduce
and fix the defect. In this state, the status of the defect posted by tester is
�New�.
Title -
Severity -
Priority -
Artifact -
Owners -
State - New
Assigned: Defects which are in the status of New will be approved (if valid) and
assigned to the development team by
Test Lead/Project Lead/Project Manager.
Ready for dev-
In dev -
Ready for Test -
In test -
Ready for showcase -
Re-opened
What is Severity?
Bug/Defect severity can be defined as the impact of the bug on the application. It
can be Critical, Major or Minor.
In simple words, how much effect will be there on the system because of a
particular defect.
Critical:
A critical severity issue is an issue where a large piece of functionality or major
system component is completely broken and there is no workaround to move further.
Major:
A major severity issue is an issue where a large piece of functionality or major
system component is completely
broken and there is a workaround to move further.
Minor:
A minor severity issue is an issue that imposes some loss of functionality, but for
which there is an acceptable & easily reproducible workaround.
For example, font family or font size or color or spelling issue.
What is Priority?
Defect priority can be defined as an impact of the bug on the customers business.
Main focus on how soon the defect should be fixed. It gives the order in which
a defect should be resolved. Developers decide which defect they should take up
next based on the priority. It can be High, Medium or Low.
A Behavior Driven Development (BDD) framework which is used with Selenium for
performing acceptance testing
1. A cucumber is a tool based on Behavior Driven Development (BDD) framework which
is used to write acceptance tests for
the web application(Prior point). Simply it defines the behaviour of a test case
with simple, Plain English.
2. It allows automation of functional validation in easily readable and
understandable format (like plain English) to
Business Analysts, Developers, Testers, etc(Prior point).
The basic concept of BDD test is to make the Test in Business readable format, so
that business users can understand it
easily.
3. Cucumber feature files can serve as a good document for all.
4. Initially, Cucumber was implemented in Ruby(language) and then extended to Java
framework.
5. Behavior Driven Development is an extension of Test Driven Development and it is
used to test the system rather
than testing the particular piece of code.
6. Cucumber can be used along with Selenium, Watir, and Capybara etc(web drivers).
Cucumber supports many other languages like
Perl, PHP, Python, Net etc
1) Feature Files:
Feature files are the essential part of cucumber which is used to write test
automation steps
2) Feature:
This gives information about the high-level business functionality. Everybody
should be able to understand the intent of
feature file by reading the first Feature step. This part is basically kept
brief
3) Scenario:
Basically, a scenario represents a particular functionality which is under test.
By seeing the scenario user should be
able to understand the intent behind the scenario and what the test is all
about. Each scenario should follow given, when
and then format. This language is called as �gherkin�.
Given: As mentioned above, given specifies the pre-conditions. It is basically a
known state.
When: This is used when some action is to be performed. As in above example, we
have seen when the user tries
to log in using username and password, it becomes an action.
Then: The expected outcome or result should be placed here. For Instance: verify
the login is successful, successful
page navigation.
Background: Whenever any step is required to perform in each scenario then those
steps need to be placed in Background.
And: And is used to combine two or more same type of action.
Example of Background:
Background:
Use case : After the requirements are clear, then the use cases can be
designed/decided which will clear the overall
flow of the system to developers first and then they can design the system
accordingly. Once the flow is clear to them,
then it becomes somehow simple to test the system by QA.
4) Scenario Outline:
Scenario outlines are used when the same test has to be performed with different
data set.
Examples:
|username |password |
|Tom |password1 |
|Harry |password2 |
5) Tags:Cucumber by default runs all scenarios in all the feature files. In real
time projects, there could be hundreds
of feature file which are not required to run at all times.
1. We have to implement these steps in Java and selenium in order to test the
feature files. Need to create a class which contains those given, when and then
statements.
Cucumber uses its annotations and all the steps are embedded in those annotations
(given, when, then).
2. Each phrase starts with �^� so that cucumber understands the start of the step.
Similarly, each step ends with �$�.
3. The user can use regular expressions to pass different test data. Regular
expressions take data from feature steps and pass to step definitions. The order
of parameters depends on how they are passed from feature file.
4. When you execute cucumber runner class, cucumber will start reading feature file
steps. For example, when you execute @smokeTest, cucumber will read Feature
step and Given a statement of scenario. As soon as cucumber finds Given the
statement, same Given statement will be searched for your java files. If the same
step is found in java file then cucumber executes the function specified for the
same step otherwise cucumber will skip the step.
@RunWith - This is a JUnit annotation that specifies which runner it has to use to
execute this class. You can see that we have provided Cucumber.class
as a parameter with this annotation. With this, JUnit will know that it has to
execute this test case as a Cucumber test.
@Cucumber.Options - This annotation provides some important information which will
be used to run your cucumber feature file.
Cucumber tags:
Cucumber has already provided a way to organize your scenario execution by using
tags in feature file. We can define
each scenario with a useful tag. Later, in the runner file, we can decide which
specific
tag (and so as the scenario(s)) we want Cucumber to execute.
Tag starts with �@�. After �@� you can have any relevant text to define your tag
like @SmokeTests just above the
scenarios you like to mark. Then to target these tagged scenarios just specify the
tags names in the CucumberOptions
as tags = {�@SmokeTests�}.
Tagging not just specifically works with Scenarios, it also works with Features.
Means you can also tag your features
files. Any tag that exists on a Feature will be inherited by Scenario, Scenario
Outline or Examples.
Cucumber supports hooks, which are blocks of code that run before or after each
scenario. You can define them anywhere
in your project or step definition layers, using the methods @Before and @After.
Cucumber Hooks allows us to better manage the code workflow and helps us to reduce
the code redundancy. We can say that
it is an unseen step, which allows us to perform our scenarios or tests.
In the same way there are always after steps as well of the tests like:
Killing the webdriver
Closing DB connections
Clearing the test data
Clearing browser cookies
Logging out from the application
Printing reports or logs
Taking screenshots on error
or anything after the test
To handle these kind of situations, cucumber hooks are the best choice to use.
Unlike TestNG Annotaions, cucumber supports only two hooks (Before & After) which
works at the start and the end of
the test scenario. As the name suggests, @before hook gets executed well before any
other test scenario, and
@after hook gets executed after executing the scenario.
Maps in Data Tables can be used in different ways. Headers/Columns can also be
defined for the test data. A same step
definition can be executed multiple times with different set of test data using
Maps.
In the previous tutorial video of Data Tables in Cucumber, we pass Username &
Password without Header, due to which
the test was not much readable. What if there will be many columns. The basic
concept of BDD test is to make the Test
in Business readable format, so that business users can understand it easily.
Webtable handling:
PART-1
We have to implement page object model(approach or design pattern) in cucumber in
the form of BDD frame work
BDD - Behavioural driven development framework i.e defining the behaviour of the
framework or test cases or use cases(What exactly
the behaviour of the use case).
To define the BDD framework Gherkin is the language we are going to use.
To understand the cucumber, We have 3 different components
a. Feature file b. Step definition file c.Runner class
Feature file - With the help of standard keywords available in Gherkin, We will
define a scenario or scenario outline.
b. The corrsponding feature file code will be written in step definition file where
will use Selenium+Java+Annotations.
c. Test Runner class using Junit. The purpose of test runner is to run the feature
file, To generate the output/report.
What are the different dependencies you will be using with cucumber?
cucumber-java
cucumber-jvm
cucumber-junit
cucumber-jvm-deps
cucumber-reporting
gherkin
junit
selenium -java
Natural plugin(To make the keywords into Feature keyword) - Search in market
eclipse place, If not google it and just drag and drop in opened eclipse
Explain writing feature file, step definition and runner class (Example:
FreeCRMBDDFramework, Loginfeature and steps file)
PART-2
What are the different cucumber options available?
All the cucumber options will be defined in Runner class.
Sol: See content above
What are the different types of reports you can generate in cucumber?
We can generate html, json,xml reports. See Runner class in FreeCRMBDD framework
code.
Explain all the cucumber options available.
PART-3
How to achieve data driven testing in cucumber?(Since we are passing hardcoded
values in sendkeys method, To avoid hardcoded values going to use data driven
approach)
See related content above
How to achieve data driven testing using Examples Keyword and without Examples
Keyword.
Refer login.feature in FreeCrmBDDFramework.
What is the difference between Scenario and Scenario outline.
Whenever we use data driven approach using Examples keyword then it becomes
scenario outline, Without Examples keyword then we need to use Scenario.
PART-4
PART-5
Now we are going to use Map object. (Refer dealsMap.feature)
Here for data tables, we can add header names and these names are going to act as
key and the data will act as value
Now particular asMaps() method will return Map object, It will store the values in
the key and value format.
How can you parametrize your test cases.
sol: By using Maps
PART-6
Cucumber Tags:See above content
Let's say I have 100 scenarios and i have to execute only particular scenarios
which are smoke tests, Then this concept
will come into the picture.
Refer tagging.feature in FreeCrmBDDFramework.
comma(,)means or, i.e it can execute either any of the tags
PART-7
Hooks in cucumber: Refer the content above
Hooks are used in the cucumber to define the preconditionds and post conditions in
the form of @Before and @After methods
Import the @Before and @After api's from cucumber not from junit
Give an example saying that, Launching the browser, Closing the browser before and
after each scenario.
For each and every scenario present in the feature file the before and after method
will execute.
The same will be applicable for the Scenario Outline also.
How to execute before and after methods for a particular scenario? Refer
taggedHooks.feature and stepdefinition file
Sol: That can be achieved by Tagged hooks. If we want to execute precondition for a
specific scenario.
Too much of hooks and tags will make confusing. Try to avoid and make simple,
robust and readable format
PART-8
Page Object model with Cucumber BDD Framework - Refer CucumberPOM
a. Baseclass - Where we initilaize the webdriver and browser we select and reading
the properties file (Done)
b. Page layer - Where we define all the page classes available. Here we will define
WebElements related to that
Particular page. All the page classes will extend the base class.
Ex: Login Page.java. It contains WebElements, login() Method which returns
HomePage object(landing page).
c. Feature file
d. Step definition
e. TestRunner class using Junit
All the above components gives the architecture of POM with cucumber BDD framework.
Next thing is each and every feature file step should be mapped with step
definition file.
Runner class has connection with step definition file and feature file.
What exactly we are doing in step def file is we will be creating number of methods
on the basis of feature file steps
and we are going to call these methods in the page classes. There is a link b/w
each and every page class with step def
files. This will give the basic architecture. Now lets start bulding it. Refer
CucumberPOM
Creation of base class is done and according to the architecture next step is
creating pages.(Done)
Whenever we are using @FindBy annotation , we need to initialize all the objects
available in that class using PageFactory class
Created Login page and Home page elements and corresponding actions. Next step is
to write feature file
Done with feature files. It's time to write step definition
Created step definition and started executing first step(TestBase.initialization).
Initially it will get NullpointerException since it's getting
property object prop as null because it hasn't been called . To avoid this we need
to extend TestBase class from step
def file since TestBase is the parent class, It will check for the constructor
defined and it executes since prop object
is initialized.
1. Static tables: Data is static i.e. Number of rows and columns are fixed.
Approach:
Below is the xpath of one of the cell in html table. Let�s say �firstname�
//div[@id=�main�]/table[1]/tbody/tr[1]/th[1]
2. Dynamic tables: Data is dynamic i.e. Number of rows and columns are NOT fixed.
(Example- ActiTime)
> Handling static table is easy, but dynamic table is a little bit difficult as
rows and columns are not constant.
a. First get the number of rows present the webtable.(Make Xpath upto
table/tbody/tr)
Xpath - int count =
/html[1]/body[1]/div[7]/div[1]/div[1]/div[1]/div[3]/table[1]/tbody[1]/tr
c. not needed -
/html[1]/body[1]/div[7]/div[1]/div[1]/div[1]/div[3]/table[1]/tbody[1]/tr[1]/td[1]/f
ollowing-sibling::td[2]/input
d. Calendar xpath -
/html[1]/body[1]/div[7]/div[1]/div[1]/div[1]/div[3]/table[1]/tbody[1]/tr[1]/td[1]/f
ollowing-sibling::td[3]/child::*/child::*/child::*/child::*/child::td[2]/em/button
e. Type of work xpath -
/html[1]/body[1]/div[7]/div[1]/div[1]/div[1]/div[3]/table[1]/tbody[1]/tr[1]/td[1]/f
ollowing-sibling::td[4]/div/table/tbody/tr/td[2]/em/button
-----------------------------------------------------------------------------------
------------------------------------
Some Good Examples:
++link: Features
1. //a[text()='Features']
2. //a[contains(text(),'Features')] --recommended
++button:
//button[@type='button' and @class='btn']
//button[contains(text(),'Sign Up')]
//div[@class='dropdown']//button[@type='button' and @class='btn btn-secondary
dropdown-toggle' and @id='dropdownMenuButton']
//button[@id='dropdownMenuButton']
++preceding-sibling:
//a[text()='test2 test2']//parent::td[@class='datalistrow']//preceding-
sibling::td[@class='datalistrow']//input
//a[text()='test2 test2']//parent::td[@class='datalistrow']//preceding-
sibling::td[@class='datalistrow']//input[@name='contact_id']
======================================================
2) INTEGRATION TESTING
Testing the data flow or interface between two features is known as integration
testing.
Ex:
Now let us consider the example of banking s/w as shown in the figure above
( amount transfer ).
Scenario 1 � Login as A to amount transfer � send 100rs amount � message should be
displayed saying �amount transfer successful� � now logout as A and login
as B � go to amount balance and check balance � balance is increased by 100rs �
thus integration test is successful.
Scenario 2 - Do positive and negative integration testing.
3) SYSTEM TESTING
It is end-to-end testing wherein testing environment is similar to the production
environment.
ACCEPTANCE TESTING
Acceptance testing is done by end users. Here, they use the s/w for the business
for a particular period of time and check whether the s/w can handle
all kinds of real-time business scenarios / situations.
SMOKE TESTING or SANITY TESTING or DRY RUN or SKIM TESTING or BUILD VERIFICATION
TESTING *** (Very very important interview question)
Testing the basic or critical features of an application before doing thorough
testing or rigorous testing is called as smoke testing.
It is also called Build Verification Testing � because we check whether the build
is broken or not.
Whenever a new build comes in, we always start with smoke testing, because for
every new build � there might be some changes which might
have broken a major feature ( fixing the bug or adding a new feature could have
affected a major portion of the original software).
In smoke testing, we do only positive testing � i.e, we enter only valid data and
not invalid data.
3) Ad-hoc is a testing where we don�t follow the requirements (we just randomly
check the application). Since we don�t follow requirements, we
don�t write test cases.
Test cases:
Test case is a document which covers all possible scenarios to test all the
feature(s).
It is a set of input parameters for which the s/w will be tested. The SRS are
numbered so that developers and testing team will not miss out on any feature.
Error Guessing :
Guessing the error. If the Amount text field asks for only integers, we enter all
other values, like � decimal, special character, negative etc. Check for
all the values mentioned above.
REGRESSION TESTING : Testing the unchanged features to make sure that it is not
broken because of the changes is called Regression Testing.
Use Case
Use case is a pictorial representation of requirements. It explains how the end
user interacts with the application. It gives all possible ways
of how the end user uses the application.
Test Plan:
1) OBJECTIVE:- It gives the aim of preparing test plan i.e, why are we preparing
this test plan.
2) SCOPE :-
2.1 Features to be tested
2.2 Features not to be tested
3) TESTING METHODOLOGIES (Types of Testing)
Depending upon the application, we decide what type of testing we do for the
various features of the application
4) APPROACH
The way we go about testing the product in future
5) ASSUMPTIONS
When writing test plans, certain assumptions would be made like technology,
resources etc.
6) RISKS
If the assumptions fail, risks are involved
7) CONTINGENCY PLAN OR MITIGATION PLAN OR BACK-UP PLAN
To overcome the risks, a contingency plan has to be made. Atleast to reduce the
percentage from 100% to 20%
8) ROLES AND RESPONSIBILITIES
9) SCHEDULES :-
10) DEFECT TRACKING
In this section, we mention � how to communicate the defects found during testing
to the development team and
also how development team should respond to it. We should also mention the priority
of the defect � high, medium, low.
10.1 Procedure to track the defect
10.2 Defect tracking tool
10.3 Severity
10.4 Priority
11) Test Environment
Remaining things look into the document.
TRACEABILITY MATRIX
Traceability Matrix is a document which has got the mapping between requirements
and test cases. We write TM to make
sure that every requirement has got atleast 1 test case.
Advantages of Traceability Matrix:
Ensures that every requirement has atleast 1 test case
If suddenly requirement is changed � we will be knowing which is the exact test
case or automation script to be modified
We will come to know which test case should be executed manually and which are to
be done automatically.
DEFECT TRACKING
Defect : If a feature is not working according to the requirement, it is called a
defect.
Deviation from requirement specification is called as defect.
Retrospect meeting � (also called Post Mortem Meeting / Project Closure Meeting)