0% found this document useful (0 votes)
7 views109 pages

Sta Final

The document outlines a practical record for a Software Testing and Automation course at C. Abdul Hakeem College of Engineering and Technology. It includes a detailed test plan for an e-commerce application, covering various components such as the homepage, master page, login and registration, search functionality, product listing, and checkout process. Each section provides specific test cases aimed at ensuring the functionality and user experience of the e-commerce site are thoroughly evaluated.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views109 pages

Sta Final

The document outlines a practical record for a Software Testing and Automation course at C. Abdul Hakeem College of Engineering and Technology. It includes a detailed test plan for an e-commerce application, covering various components such as the homepage, master page, login and registration, search functionality, product listing, and checkout process. Each section provides specific test cases aimed at ensuring the functionality and user experience of the e-commerce site are thoroughly evaluated.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 109

C. ABDUL HAKEEM COLLEGE OF ENGINEERING AND TECHNOLOGY, MELVISHARAM.

Hakeem Nagar, Melvisharam - 632 509, Ranipet District, Tamil Nadu, India.

(Approved by AICTE, New Delhi and Affiliated to Anna University, Chennai)

(Regd. Under Sec 2(F) & 12(B) of the UGC Act 1956)

DEPARTMENT OF ARTIFICIAL INTELLIGENCE AND DATA SCIENCE


CCS366-SOFTWARE TESTING AND AUTOMATION RECORD

(REGULATION - 2021)

Name of the Student:

Register Number:

Degree / Branch:

Year / Semester:

Academic Year:

1
C. ABDUL HAKEEM COLLEGE OF ENGINEERING AND TECHNOLOGY
Hakeem Nagar, Melvisharam - 632 509, Ranipet District, Tamil Nadu, India.
(Approved by AICTE, New Delhi and Affiliated to Anna University, Chennai)
( Regd.Under Sec 2(F) & 12(B) of the UGC Act 1956)

Name of the Candidate:

Year: III Semester: VI Degree/Branch: B. TECH/AIDS

Subject Code: CCS366


Subject Name: SOFTWARE TESTING AND AUTOMATION

University Register Number:

CERTIFICATE

Certified that this is the bonafide record of work done by the above in
CCS335 –NEURAL NETWORK AND DEEP LEARNING LABduring 2024 - 2025.

Signature of Lab In-charge Signature of Head of the Department

Submitted for the University Practical Examination held on


EXAMINERS

Date: Centre code: 5106

Internal: External:
2
CONTENTS

S. NO DATE EXPERIMENTS PAGE.NO SIGNATURE


EX NO 1 Develop the tests plan for testing an e-commerce web/mobile application
(www.amazon.in).

Aim

Procedure

Test Plan for Ecommerce Website Testing

1 –Homepage
2 – Master page (Header &Footer)
3 –Login&Registration
4 – My Account Page
5 –SearchFeature
6 – Product Listing Page (PLP)
7– Product Details Page (PDP)
8– Shopping Cart
9 –CheckoutFlow
10 –OrderConfirmationPage

1 – Testing Homepage of an ecommerce Site

Obviously homepage of any website is the very first page that many users see. Homepages in
ecommerce websites actually go far beyond than just a landing page. Besides a clickable hero image or
product slideshow with auto-scroll features, homepage of an online store can actually serve as a
powerful marketing tool. Here are some essential test cases that your ecommerce testing team should
focus when testing the homepage:
– Does the hero carousel autoscroll? If so, then at what interval (image refresh time)?
– Does the hero carousel continue to autoscroll when the user hovers mouse over the image? Does
thescrolling pause or continue to auto scroll to the next image slide?
– When clicked on one of the slider images or call to action (CTA) buttons, is it taking the customer
tothe intended page?
– Is the hero slider scrolling too fast?
– Is the homepage loading speed acceptable?
Is the rest of the homepage content such as the newsletters, banners, social media links in the site footer
etc easily viewable?
– Does the homepage load and appear the same way across supported browsers and screen
resolutions?
– Can the shopping cart be easily located from homepage?
– Can the login/signup button be easily located from homepage?
– Can the contact information be easily located from homepage?

2 – Testing the Master page of an Online Shopping Website

Unlike most other pages, the master page of an ecommerce site is not a stand-alone page but consists of
page components that are used in most of the other pages. Typically, the master page consists of the
header, the navigation menu and the footer components. Here are some important test cases that your
ecommerce QA team should focus when testing the master page components:
– Do the master page components appear on all page types as expected?
– Does the site logo appear as per the design?
– Is the website logo clickable and takes user to the site homepage?
– Is the navigation menu appearing as per the design?
– Does the nav menu constitute all the sub−menus and mega−menu (if implemented)?
– Does the nav menu turn to a burger menu when viewed on smaller screen breakpoints (e.g.
mobileand tablet screens)?
– Is the footer appearing as per they design?
– Are all the footer components (e.g. footer menu, footer logos, legal links such as privacy
policy,terms & conditions, the © notice and social icons etc) appearing as expected?
– Does the footer menu turn into an accordion to save space on smaller screen sizes (e.g. mobile
andtablet screens)?

3 – Testing the Login & Registration flow of an eCommerce Site

While all of the ecommerce sites have user registration feature, some of them do allow their customers
to purchase products as a guest, i.e. without forcing them to register and create an account, and then
with an optional step to create an account in the order confirmation page after the order has been
placed. Once an account has been created, the user can choose to log in at any stage during a checkout
process. Here are some good test cases for your ecommerce testing team to focus when testing the login
and registration process:
– Assuming that the site permits this, can the customer purchase items as a guest user?
– Can a guest user easily create an account from the order confirmation page after the order has
beenplaced?
– Can a guest user register as a member from the registration page?
– Once logged in, are the products in the cart getting correctly associated with the logged in member’s
account?
– Once logged in, is the user still being prompted to sign in? This shouldn’t happen.
– Are the login redirects working as expected and whether the user is being redirected to the
correctpage after completing a particular user journey?
– Are the user sessions being maintained for the intended time period?
– Is the user’s session timing out and expiring after the stipulated time?

4 – Testing the My Account of an Online Web Store


My Account area can differ from site to site but typically they contain pages such as My Account,
Account Information, Address Book, My Orders, Newsletter Subscriptions and a link to Log Out. Here
are some good test cases for your ecommerce QA team to focus when testing the My Account areas:

– Is the logged out user prevented from accessing My Account areas?


– Is a logged in user able to access My Account areas?
– Is the user able to add, edit, modify and access their account information (e.g. Name,
Email,Password etc) in the Account Information area?
– Is the user able to add, edit, modify and access all the addresses in the Address Book?
– Are the addresses that the user is adding, editing, modifying in the checkout flow appearing
asexpected in the Address Book?
– Is the customer able to view, track, cancel and reorder his past orders in My Orders area?
– Is the user able to enable and disable newsletter subscriptions in Newsletter Subscriptions area?
– Is the user able to log out of his session using the Log Out link?

5 – Testing the Search feature of an eCommerce Site

Believe it or not, the search feature is one of the most-used features in an ecommerce store. Even with
ecommerce sites with sophisticated product listing (category) pages and easy to use navigation,
customers often find it easier to use the website search feature to find exactly what they are looking for.
Here are some important test cases for your ecommerce testing team to focus when testing the Search
features:
– Is the search feature robust enough to allow searching by product names, brand names or
product categories etc? e.g. iPhone X, Apple iPhone, latest iPhone models, cheap iPhone, iPhones
in 2023 oreven just iPhones etc.
– Are the search results relevant for all variations of search keywords?
– Does the search result page have sorting options?
If sorting option is available on search results page, then can customers sort the results based on price
(highto low, low to high), date ranges, brand, review / ratings etc?

– Is pagination option available on search results page when a long list of products are displayed?
– How many results are displayed on each page?
– Does the next page load automatically when user scrolls? If not, can the user easily navigate to
thenext search result page using pagination?

6 – Testing the Categories or Product Listing Page (PLP) of an Online ShoppingStore

While it is neither possible nor prudent to test each and every category page of an ecommerce site,
these pages list products that the customers are looking for and hence you must test at least few of the
product listing pages randomly to ensure everything is in order. Here are some critical test cases for
your ecommerce QA team to focus when testing the Category or Product Listing Page:

– Does this page display the correct products based on the selected category?
– Does this page display proper sorting options based on price (high to low, low to high), date
ranges,brand, review / ratings etc?
– Does this page display proper filter options?
– Is pagination option available on this page when a long list of products are displayed?
– How many results are displayed on each page?
– Does the next page load automatically when user scrolls? If not, can the user easily navigate to
thenext page using pagination?
– Does this page display the correct recommended products based on the selected category?
– Does this page display the correct related products based on the selected category?
– Does this page display the correct featured products based on the selected category?

7 – Testing the Product Details Page (PDP) of an eCommerce Site

Whether you realize this or not, but this is the page where every other page (home page, the navigation
menu, category pages, search result pages etc) is trying to drive traffic in. Thus, the product details page
is the page that ultimately begins the checkout flow journey that results in revenue for every
ecommerce sites. Here are some crucial test cases for your ecommerce testing team to focus when
testing the Product Details Page:

– Does this page display all the product related information (e.g. product name, SKU, price, discount
ifany, product images, product specifications, user reviews, Add to Cart button, quantity changer etc)
as expected?
– Does this precut display other similar products that were bought by customers who purchased
thisitem?
– Can the customer customize the product if it is a customizable product and available with
variations(size, colors etc)?
– Does this page show the stock availability accurately?
– Can the user select required number of items using the quantity selector and then add the
product tocart?
– Does this product gets added to cart when added?
– Does the quantity in cart get updated when the product is added to cart?

8 – Testing the Shopping Cart of an Online Shopping Platform

Shopping cart is one of the crucial components of an ecommerce website for obvious reasons. Just like
physical shopping baskets, the shopping carts in an ecommerce website allows the customers to select
and store multiple different items in their cart and then purchase them together when ready. Here are
some key test cases, which should be part of testing a shopping cart.
– Does the cart get updated to show updated quantity when an item is added to it?
– Does the mini−cart (that slides when you click on the cart icon) correctly reflect the items,
theirquantity and price?
– Can you increase or decrease quantity of an item from the cart and mini−cart?
– Can you remove an item from the cart and mini−cart?
– Can you add the item several times to the cart?
– Can you add several variations (e.g. color, size etc) of the same item to the cart?
– Can you add several items of different types to the cart?
– Can you visit the product detail page by clicking on an item from the cart?
– Does the cart still remembers the items, their quantity and price correctly even if you
accidentallyclose the browser and then reopen it?
– Does the cart still remembers the items, their quantity and price correctly even if you log out as
themember and then logs back in?
– Can you apply valid coupon codes and discount vouchers in the cart?
– Does the discount get correctly applied when valid coupon codes and discount vouchers
are appliedin the cart?

9 – Testing the Checkout Flow of an ecommerce Site

The Checkout flow is the user journey that takes place when the user decides to move the added product
items from the shopping cart and to finally purchase them. In the checkout process, usually theuser is
required to provide shipping details, billing information and payment details to complete the purchase.
Timed out or unsuccessful transactions are one of the top reasons why most online shoppers abandon an
ecommerce website without completing their purchase. Failed transactions are thus one of the main
reasons of abandoned carts. Here are some of the most crucial test cases to test during the checkout flow.
– If the user is already logged in, does their shipping and billing information get auto−
filled incheckout?
– If the user is a guest user, can they enter their shipping and billing information?
– Do all the types of supported payment methods work?
– Can customers check out as guests and make payments?
– For returning customers, does the checkout page prompt them to sign in?
– Are sensitive information such as customer’s credit card details, PayPal / Amazon Pay /
Google Pay /Apple Pay credentials, etc handled securely and not stored on the site’s server?
– Is the user taken to Order Confirmation page upon successful checkout?

10 – Testing the Order Confirmation Page of an Online Shopping Portal

This is the final step of the checkout flow user journey and is displayed only when each steps of the
checkout including shipping, billing and payment are successful. Here are some of the most
importanttest cases to test on the order confirmation page.
– Does this page display the Order ID correctly?
– Does this page display the product details correctly?
– Does this page offer an easy way to create account, in case of guest users?
– Does the customer receive an order confirmation email / SMS text message along with the
order

RESULT:
EX NO : 2 DEVELOP TEST CASES FOR TESTING E -COMMERCE
APPLICIATION

AIM:

HOME PAGE

Test Module Name Test Scenario Test Case


Case ID
TC001 Home Page Verify the details on Home page Verify that home page is displayed
after login or not.

TC002 Home Page Verify the details on Home page Verify that user name is displayed on
home page or not

TC003 Home Page Verify the details on Home page Verify that featured products are
displayed on home page

TC004 Home Page Verify the details on Home page Verify that Search Functionality is
present on home page.

TC005 Home Page Verify the details on Home page Verify the home page of application on
different browsers.

TC006 Home Page Verify the details on Home page Verify the alignment on the home page

TC007 Home Page Verify the details on Home page Verify that products displayed on home
page are clickable.

TC008 Home Page Verify the details on Home page Verify that when user clicks on a
product, user should be redirected to
product specification page.
TC009 Home Page Verify the details on Home page Verify that user profile section is
present on home page.

TC0010 Home Page Verify the details on Home page Verify that products displayed on home
page are categorised.

SEARCH FUNTIONALTY

Test Module Name Test Scenario Test Case


Case ID
TC001 Product Search Verify the product search Verify that search field accepts
functionality alphabets, numbers or symbols.

TC002 Product Search Verify the product search Verify that after entering search text
functionality and clicking on search icon, the search
should be performed.

TC003 Product Search Verify the product search Verify that the search results should be
functionality as per the search query.

TC004 Product Search Verify the product search Verify that user should be able to
functionality search based on product name,brand
name or product specification.

TC005 Product Search Verify the product search Verify that filter should be present for
functionality filtering the search results bases on
Brand, Price, Reviews or Ratings.

TC006 Product Search Verify the product search Verify that sorting options should be
functionality present on search results page.

TC007 Product Search Verify the product search Verify that the number of search results
functionality displayed on one page.
TC008 Product Search Verify the product search Verify that there should be navigation
functionality button(Next and Previous) for
navigation to pages.

TC009 Product Search Verify the product search Verify that user should be perform search in
functionality different categories for example, Movies,
Books, Grocery etc.

PRODUCT DETAILS

Test Module Name Test Scenario Test Case


Case ID

TC001 Product Verify the details on Product Verify that images of product are
Details Specification page displayed correctly.

TC002 Product Verify the details on Product Verify that price of product is
Details Specification page displayed.

TC003 Product Verify the details on Product Verify that product reviews are
Details Specification page mentioned.

TC004 Product Verify the details on Product Verify that product specifications are
Details Specification page displayed.

TC005 Product Verify the details on Product Verify that information about IN-
Details Specification page Stock/Out-Stock are displayed.

TC006 Product Verify the details on Product Verify that seller ratings should be
Details Specification page displayed.
TC007 Product Verify the details on Product Verify that all the variations of product
Details Specification page are displayed.

TC008 Product Verify the details on Product Verify that shipping information about
Details Specification page product are displayed.

TC009 Product Verify the details on Product Verify that payment options are
Details Specification page mentioned on product page.

TC0010 Product Verify the details on Product Verify that product suggestions related
Details Specification page to product should be displayed.

CART PAGE

Test Module Name Test Scenario Test Case


Case
ID
TC001 Cart Page Verify the details on Cart Page Verify that when user clicks on add to
cart, the product should be added to cart.

TC002 Cart Page Verify the details on Cart Page Verify that user should be able to
continue shopping after adding items to
cart.

TC003 Cart Page Verify the details on Cart Page Verify that item quantity should be
increased if user adds same item in cart
again.

TC004 Cart Page Verify the details on Cart Page Verify that total amount of all items
should be displayed to user.

TC005 Cart Page Verify the details on Cart Page Verity that the amount displayed to user
should include the taxes and shipping
charges as per location.

TC006 Cart Page Verify the details on Cart Page Verify that user should not be able to add
items in cart beyond a certain limit.

TC007 Cart Page Verify the details on Cart Page Verify that when user clicks on remove
from cart button the item should be
removed from cart.

TC008 Cart Page Verify the details on Cart Page Verify that user should be able to apply
coupons or vouchers at checkout from
cart.

TC009 Cart Page Verify the details on Cart Page Verify that items in cart should be present
if user logs out and logs in again.

CHECK OUT, PAYMENT PAGE


Test Module Name Test Scenario Test Case
Case ID
TC001 Checkout,Pay Verify the details on Verify that payments options applicable
ments Page Checkout,Payments Page for the order should be displayed at
checkout.

TC002 Checkout,Pay Verify the details on Verify that delivery details of items
ments Page Checkout,Payments Page should be displayed at checkout.
TC003 Checkout,Pay Verify the details on Verify that user should get order details
ments Page Checkout,Payments Page by message or email.

TC004 Checkout,Pay Verify the details on Verify that user should be directed to
ments Page Checkout,Payments Page home page after checkout.

TC005 Checkout,Pay Verify the details on Verify that user should be displayed
ments Page Checkout,Payments Page payment options such as Credit Card,
Debit Card, Net Banking etc.

TC006 Checkout,Pay Verify the details on Verify that if user is not registered then
ments Page Checkout,Payments Page payment should be done as Guest user.

TC007 Checkout,Pay Verify the details on Verify that user should be provided
ments Page Checkout,Payments Page with an option to save the payment
method.

TC008 Checkout,Pay Verify the details on Verify that session should be timed out
ments Page Checkout,Payments Page if payment is not done for a certain
time.

TC009 Checkout,Pay Verify the details on Verify that user details should be
ments Page Checkout,Payments Page displayed on payment page for
registered customers.

TC001 Checkout,Pay Verify the details on Verify that on successful payment


0 ments Page Checkout,Payments Page email or text message should be
delivered to customer along with
unique order number.

MY ORDER PAGE

Test Case ID Module Name Test Scenario Test Case


TC001 My Orders Verify the details on Orders Page Verify that user should be able to
Page track the order on My orders page.

TC002 My Orders Verify the details on Orders Page Verify that user should be able to
Page change the delivery date and time.

TC003 My Orders Verify the details on Orders Page Verify that user should be able to
Page cancel the order

TC004 My Orders Verify the details on Orders Page Verify that user should be able to
Page return the order after delivery of order.

TC005 My Orders Verify the details on Orders Page Verify that user should be able to
Page exchange the order from My orders
page.
TC006 My Orders Verify the details on Orders Page Verify that user should be able to
Page provide feed back and reviews about
the item delivered.

CUSTOMER SERVICE PAGE

Test Case Module Test Scenario Test Case


ID Name
TC001 Customer Verify the details on Customer Verify that customer service
Service Page Service Page options should be present on the
website.

TC002 Customer Verify the details on Customer Verify that different modes of
Service Page Service Page customer service such as Email,
Chat or Call should be mentioned.

TC003 Customer Verify the details on Customer Verify that waiting time to connect
Service Page Service Page to customer service shold be
displayed to user.

TC004 Customer Verify the details on Customer Verify that customer service
Service Page Service Page should be available in different
languages.

TC005 Customer Verify the details on Customer Verify that the timings of customer
Service Page Service Page service option should be displayed
to user.

RESULT:
EX NO : 3 TEST THE E-COMMERCE APPLICATION AND REPORT THE DEFECTS IN IT

AIM:

HOME PAGE

Test Modul Test Test Pre- Test Data Step Test Expected Result Actual Status Defect
Case e Scenario Case requisites No. Step Result ID
ID Name
TC00 Home Verify Verify Browser Username 1 Open Browser should
1 Page the that should be - browser be opened
details home installed Username
on Home page is Internet Password- 2 Open url Ecommerce
page display connectio password website should
ed after n should be opened
login or be present
not. 3 Enter user should be
usernam able to input
e and username and
password password
4 Click on Home page
login should be
button displayed after
login
TC00 Home Verify Verify Browser 1 Open Browser should
2 Page the that should be browser be opened
details user installed 2 Open url Ecommerce
on Home name is Internet website should
page display connectio be opened
ed on n should 3 Enter user should be
home be present usernam able to input
page or User e and username and
not should be password password
logged in 4 Click on Home page
login should be
button displayed after
login and user
name should be
displayed on
home page
TC00 Home Verify Verify Browser 1 Open Browser should
3 Page the that should be browser be opened
details feature installed 2 Open url Ecommerce
on Home d Internet website should
page product connectio be opened
s are n should
display be present 3 Enter user should be
ed on User usernam able to input
home should be e and username and
page logged in password password
4 Click on Home page
login should be
button displayed after
login and user
name should be
displayed on
home page
TC00 Home Verify Verify Browser 1 Open Browser should
4 Page the that should be browser be opened
details Search installed
on Home Functio Internet
page nality connectio
2 Open url Ecommerce
is n should
website should
present be present
be opened
on User
3 Enter user should be
home should be
usernam able to input
page. logged in
e and username and
password password
4 Click on User should be
login logged in and
button Search
functionality is
present on home
page.
TC00 Home Verify Verify Browser 1 Open Browser should
5 Page the the should be browser be opened
details home installed
on Home page of Internet 2 Open url Ecommerce
page applicat connectio website should
ion on n should be opened
differen be present 3 Enter user should be
t User usernam able to input
browse should be e and username and
rs. logged in password password
4 Click on User should be
login logged in and
button home page
should be same
on different
browsers.
TC00 Home Verify Verify Browser 1 Open Browser should
6 Page the the should be browser be opened
details alignm installed
on Home ent on Internet
page the connectio
2 Open url Ecommerce
home n should
website should
page be present be opened
User 3 Enter user should be
should be usernam able to input
logged in e and username and
password password
4 Click on User should be
login logged in and
button alignment of
products on
home page
should be proper.
TC00 Home Verify Verify Browser 1 Open Browser should
7 Page the that should be browser be opened
details product installed
on Home s Internet
page display connectio
2 Open url Ecommerce
ed on n should
website should
home be present be opened
page User
3 Enter user should be
are should be
usernam able to input
clickabl logged in
e and username and
e.
password password
4 Click on Home page
login should be
button displayed after
login and user
name should be
displayed on
home page
5 Click on User should be
any redirected to
product product
displaye specification
d on page.
home
page
TC00 Home Verify Verify Browser 1 Open Browser should
8 Page the that should be browser be opened
details when installed
on Home user Internet 2 Open url Ecommerce
page clicks connectio website should
on a n should be opened
product be present 3 Enter user should be
, user User usernam able to input
should should be e and username and
be logged in password password
redirect 4 Click on Home page
ed to login should be
product button displayed after
specific login and user
ation name should be
page. displayed on
home page
5 Click on User should be
any redirected to
product product
displaye specification
d on page.
home
page
TC00 Home Verify Verify Browser 1 Open Browser should
9 Page the that should be browser be opened
details user installed
on Home profile Internet
page section connectio
2 Open url Ecommerce
is n should
website should
present be present be opened
on User
3 Enter user should be
home should be
usernam able to input
page. logged in
e and username and
password password
4 Click on Home page
login should be
button displayed after
login and user
name should be
displayed on
home page
5 Click on User profile
user should be
name displayed.
displaye
d on
home
page.
TC00 Home Verify Verify Browser 1 Open Browser should
10 Page the that should be browser be opened
details product installed
on Home s Internet
page display connectio
2 Open url Ecommerce
ed on n should
website should
home be present
be opened
page User
3 Enter user should be
are should be
usernam able to input
categor logged in
e and username and
ised.
password password
4 Click on Used should be
logged in and home
login
page should be
button displayed, products
should categorised.
SEARCH FUNTIONALTY

Test Module Test Test Pre- Test Data Step Test Step Expected Result Actual Status Defect
Cas Name Scenario Case requisites No. Result id
e ID
TC0 Product Verify Verify Browser Username- 1 Open Browser should be
01 Search the that should be Username browser opened
product search installed Password- 2 Open url Ecommerce website
search field Internet password should be opened
functiona accepts connection 3 Enter user should be able
lity alphabets should be username to input username
, present and and password
numbers User password
or should be 4 Click on Home page should
symbols. logged in login button be displayed after
login
5 Click on Search field should
search field. accepts alphabets,
numbers or
symbols.
TC0 Product Verify Verify Browser 1 Open Browser should be
02 Search the that after should be browser opened
product entering installed 2 Open url Ecommerce website
search search Internet should be opened
functiona text and connection 3 Enter user should be able
lity clicking should be username to input username
on present and and password
search User password
icon, the should be 4 Click on Home page should
search logged in login button be displayed after
should login and user name
be should be displayed
performe on home page
d. 5 Enter search Search should be
text in performed
search field according to search
and click on text provided by
search icon. user.
TC0 Product Verify Verify Browser 1 Open Browser should be
03 Search the that the should be browser opened
product search installed 2 Open url Ecommerce website
search results Internet should be opened
functiona should connection 3 Enter user should be able
lity be as per should be username to input username
the present and and password
search User password
query. should be 4 Click on Home page should
logged in login button be displayed after
login and user name
should be displayed
on home page
5 Enter search Search should be
text in performed
search field according to search
and click on text provided by
search icon. user.
TC0 Product Verify Verify Browser 1 Open Browser should be
04 Search the that user should be browser opened
product should installed 2 Open url Ecommerce website
search be able Internet should be opened
functiona to search connection 3 Enter user should be able
lity based on should be username to input username
product present and and password
name,bra User password
nd name should be
4 Click on User should be
or logged in
login button logged in and
product
Search functionality
specifica is present on home
tion. page.
5 Enter search User should be able
text in to perform search
search field bases on product
and click on name, brand name
search icon. or product
specification.
TC0 Product Verify Verify Browser 1 Open Browser should be
05 Search the that filter should be browser opened
product should installed 2 Open url Ecommerce website
search be Internet should be opened
functiona present connection 3 Enter user should be able
lity for should be username to input username
filtering present and and password
the User password
search should be 4 Click on User should be
results logged in login button logged in and home
bases on page should be
Brand, same on different
Price, browsers.
Reviews 5 Enter search Search should be
or text in performed
Ratings. search field according to search
and click on text provided by
search icon. user and filters
should be present.
TC0 Product Verify Verify Browser 1 Open Browser should be
06 Search the that should be browser opened
product sorting installed 2 Open url Ecommerce website
search options Internet should be opened
functiona should connection 3 Enter user should be able
lity be should be username to input username
present present and and password
on User password
search should be 4 Click on User should be
results logged in login button logged in and
page. alignment of
products on home
page should be
proper.
5 Enter search Search should be
text in performed
search field according to search
and click on text provided by
search icon. user and sorting
options should be
present on search
results page.
TC0 Product Verify Verify Browser 1 Open Browser should be
07 Search the that the should be browser opened
product number installed 2 Open url Ecommerce website
search of search Internet should be opened
functiona results connection 3 Enter user should be able
lity displaye should be username to input username
d on one present and and password
page. User password
should be 4 Click on Home page should
logged in login button be displayed after
login and user name
should be displayed
on home page
5 Enter search Search should be
text in performed
search field according to the
and click on search text provided
search icon. and a specific
number of results
should be displayed
on one page.
TC0 Product Verify Verify Browser 1 Open Browser should be
08 Search the that there should be browser opened
product should installed 2 Open url Ecommerce website
search be Internet should be opened
functiona navigatio connection 3 Enter user should be able
lity n should be username to input username
button(N present and and password
ext and User password
Previous should be 4 Click on Home page should
) for logged in login button be displayed after
navigatio login and user name
n to should be displayed
pages. on home page
5 Enter search Search should be
text in performed
search field according to text
and click on provided by user
search icon. and navigation
button should be
present on search
result page.
TC0 Product Verify Verify Browser 1 Open Browser should be
09 Search the that user should be browser opened
product should installed 2 Open url Ecommerce website
search be Internet should be opened
functiona perform connection 3 Enter user should be able
lity search in should be username to input username
different present and and password
categorie User password
s for should be 4 Click on Home page should
example, logged in login button be displayed after
Movies, login and user name
Books, should be displayed
Grocery on home page
etc. 5 Enter search Search should be
text in performed in
search field different categories
and click on such as movies,
search icon. books, grocery etc.
PRODUCT DETAILS

Test Module Test Test Pre- Test Data Ste Test Step Expected Result Actual Status Defec
Case Name Scenari Case requisites p Result t ID
ID o No.

TC0 Product Verify Verify Browser Username 1 Open Browser should


01 Details the that should be - browser be opened
details images installed Username
on of Internet Password- 2 Open url Ecommerce
Product produc connection password website should be
Specific t are should be opened
ation displa present 3 Enter user should be
page yed username able to input
correct and username and
ly. password password

4 Click on Home page


login should be
button displayed after
login

5 Click on a the images of


product product should be
displayed displayed
on home correctly.
page.

TC0 Product Verify Verify Browser 1 Open Browser should


02 Details the that should be browser be opened
details price installed
on of Internet 2 Open url Ecommerce
Product produc connection website should be
Specific t is should be opened
ation displa present 3 Enter user should be
page yed. User username able to input
should be and username and
logged in password password

4 Click on Home page


login should be
button displayed after
login and user
name should be
displayed on
home page

5 Click on a the images of


product product should be
displayed displayed
on home correctly.
page.

TC0 Product Verify Verify Browser 1 Open The price of


03 Details the that should be browser product should be
details produc installed displayed.
on t Internet
Product review connection 2 Open url Ecommerce
Specific s are should be website should be
ation mentio present opened
page ned. User 3 Enter user should be
should be username able to input
logged in and username and
password password

4 Click on Home page


login should be
button displayed after
login and user
name should be
displayed on
home page

5 Click on a The reviews about


product the product should
displayed be displayed.
on home
page.

TC0 Product Verify Verify Browser 1 Open Browser should


04 Details the that should be browser be opened
details produc installed
on t Internet 2 Open url Ecommerce
Product specifi connection website should be
Specific cations should be opened
ation are present 3 Enter user should be
page displa User username able to input
yed. should be and username and
logged in password password

4 Click on User should be


login logged in and
button Search
functionality is
present on home
page.

5 Click on a Product
product specifications
displayed should be
on home displayed.
page.

TC0 Product Verify Verify Browser 1 Open Browser should


05 Details the that should be browser be opened
details inform installed
on ation Internet 2 Open url Ecommerce
Product about connection website should be
Specific IN- should be opened
ation Stock/ present 3 Enter user should be
page Out- User username able to input
Stock should be and username and
are logged in password password
displa
yed. 4 Click on User should be
login logged in and
button home page should
be same on
different
browsers.

5 Click on a Stock information


product should be
displayed displayed.
on home
page.

TC0 Product Verify Verify Browser 1 Open Browser should


06 Details the that should be browser be opened
details seller installed
on ratings Internet 2 Open url Ecommerce
Product should connection website should be
Specific be should be opened
ation displa present 3 Enter user should be
page yed. User username able to input
should be and username and
logged in password password

4 Click on User should be


login logged in and
button alignment of
products on home
page should be
proper.

5 Click on a The seller ratings


product should be
displayed displayed.
on home
page.

TC0 Product Verify Verify Browser 1 Open Browser should


the that all should be
07 Details details the installed browser be opened
on variati Internet
Product ons of connection
2 Open url Ecommerce
Specific produc should be
website should be
ation t are present
opened
page displa User
yed. should be 3 Enter user should be
logged in username able to input
and username and
password password

4 Click on Home page


login should be
button displayed after
login and user
name should be
displayed on
home page

5 Click on User should be


any product redirected to
displayed product
on home specification
page page.

6 Click on a All the variations


product of product should
displayed be displayed.
on home
page.

TC0 Product Verify Verify Browser 1 Open Browser should


08 Details the that should be browser be opened
details shippi installed
on ng Internet
Product inform connection 2 Open url Ecommerce
Specific ation should be website should be
ation about present opened
page produc User 3 Enter user should be
t are should be username able to input
displa logged in and username and
yed. password password

4 Click on Home page


login should be
button displayed after
login and user
name should be
displayed on
home page

5 Click on User should be


any product redirected to
displayed product
on home specification
page page.

6 Click on a the images of


product product should be
displayed displayed
on home correctly.
page.

TC0 Product Verify Verify Browser 1 Open The shipping


09 Details the that should be browser information
details payme installed should be
on nt Internet displayed.
Product option connection
Specific s are should be 2 Open url Ecommerce
ation mentio present website should be
page ned on User opened
produc should be 3 Enter user should be
t page. logged in username able to input
and username and
password password

4 Click on Home page


login should be
button displayed after
login and user
name should be
displayed on
home page

5 Click on User profile


user name should be
displayed displayed.
on home
page.

6 Click on a The payment


product options should be
displayed displayed.
on home
page.

TC0 Product Verify Verify Browser 1 Open Browser should


010 Details the that should be browser be opened
details produc installed
on t Internet 2 Open url Ecommerce
Product sugges connection website should be
Specific tions should be opened
ation related present 3 Enter user should be
page to User username able to input
produc should be and username and
t logged in password password
should
4 Click on Used should be
be
login button logged in and home
displa
page should be
yed. displayed, products
should be
categorised.

5 Click on a The product


product suggestions should
displayed on be displayed.
home page.

CART PAGE

Test Module Test Test Pre- Test Data Step Test Step Expected Result Actual Statu Defec
Case Name Scenari Case requisites No. Result s t ID
ID o
TC0 Cart Verify Verify Browser Username- 1 Open Browser should be
01 Page the that should be Username browser opened
details when installed Password- 2 Open url Ecommerce website
on Cart user Internet password should be opened
Page clicks connectio 3 Enter user should be able
on add n should username to input username
to cart, be and and password
the present password
produc 4 Click on Home page should
t login be displayed after
should button login
be 5 Click on The product page
added any should be
to cart. product displayed.
displayed
on home
page
6 Click on The product should
add to be added to cart.
cart for
the
product.
TC0 Cart Verify Verify Browser 1 Open Browser should be
02 Page the that should be browser opened
details user installed 2 Open url Ecommerce website
on Cart should Internet should be opened
Page be able connectio 3 Enter user should be able
to n should username to input username
contin be and and password
ue present password
shoppi User 4 Click on Home page should
ng should be login be displayed after
after logged in button login and user name
adding should be displayed
items on home page
to cart. 5 Click on The product page
any should be
product displayed.
displayed
on home
page
6 Click on The product should
add to be added to cart and
cart for user can continue
the shopping.
product.
TC0 Cart Verify Verify Browser 1 Open Browser should be
03 Page the that should be browser opened
details item installed 2 Open url Ecommerce website
on Cart quantit Internet should be opened
Page y connectio 3 Enter user should be able
should n should username to input username
be be and and password
increas present password
ed if User 4 Click on Home page should
user should be login be displayed after
adds logged in button login and user name
same should be displayed
item in on home page
cart 5 Click on The product page
again. any should be
product displayed.
displayed
on home
page
6 Click on The product should
add to be added to cart.
cart for
the
product.
7 Click on The item quantity
add to should be increases.
cart again
for the
same
product.
TC0 Cart Verify Verify Browser 1 Open Browser should be
04 Page the that should be browser opened
details total installed
on Cart amoun Internet 2 Open url Ecommerce website
should be opened
Page t of all connectio
items n should 3 Enter user should be able
should be username to input username
and and password
be present password
display User 4 Click on User should be
ed to should be login logged in and
user. logged in button Search functionality
is present on home
page.
5 Click on The product page
any should be
product displayed.
displayed
on home
page
6 Click on The product should
add to be added to cart.
cart for
the
product.
7 Click on The total amount of
go to cart all items in cart
button. should be
displayed.
TC0 Cart Verify Verity Browser 1 Open Browser should be
05 Page the that should be browser opened
details the installed
on Cart amoun Internet 2 Open url Ecommerce website
should be opened
Page t connectio
display n should 3 Enter user should be able
ed to be username to input username
user present and and password
should User password
include should be 4 Click on User should be
the logged in login logged in and home
taxes button page should be
and same on different
shippin browsers.
g 5 Click on The product page
charge any should be
s as product displayed.
per displayed
locatio on home
n. page
6 Click on The product should
add to be added to cart.
cart for
the
product.
7 Click on The total amount
go to cart should include
button. taxes and shipping
charges.
TC0 Cart Verify Verify Browser 1 Open Browser should be
06 Page the that should be browser opened
details user installed
on Cart should Internet 2 Open url Ecommerce website
should be opened
Page not be connectio 3 Enter user should be able
able to n should username to input username
add be and and password
items present password
in cart User 4 Click on User should be
beyond should be login logged in and
a logged in button alignment of
certain products on home
limit. page should be
proper.
5 Click on The product page
any should be
product displayed.
displayed
on home
page
6 Click on The user should not
add to be allowed to add
cart for items to cart beyond
the a certain limit.
product
for many
times.
TC0 Cart Verify Verify Browser 1 Open Browser should be
07 Page the that should be browser opened
details when installed
on Cart user Internet 2 Open url Ecommerce website
Page clicks connectio should be opened
on n should 3 Enter user should be able
remov be username to input username
e from present and and password
cart User password
button should be 4 Click on Home page should
the logged in login be displayed after
item button login and user name
should should be displayed
be on home page
remov 5 Click on User should be
ed any redirected to
from product product
cart. displayed specification page.
on home
page
6 Click on The product page
any should be
product displayed.
displayed
on home
page
7 Click on The product should
add to be added to cart.
cart for
the
product.
8 Click on The item should be
remove removed form cart.
from cart
button.
TC0 Cart Verify Verify Browser 1 Open Browser should be
08 Page the that should be browser opened
details user installed
on Cart should Internet
Page be able connectio 2 Open url Ecommerce website
to n should should be opened
apply be 3 Enter user should be able
coupon present username to input username
s or User and and password
vouche should be password
rs at logged in 4 Click on Home page should
checko login be displayed after
ut button login and user name
from should be displayed
cart. on home page
5 Click on User should be
any redirected to
product product
displayed specification page.
on home
page
6 Click on The product page
any should be
product displayed.
displayed
on home
page
7 Click on The product should
add to be added to cart.
cart for
the
product.
8 Click on User should be able
go to cart to apply cupons or
button. vouchers.
TC0 Cart Verify Verify Browser 1 Open Browser should be
09 Page the that should be browser opened
details items installed
on Cart in cart Internet 2 Open url Ecommerce website
should be opened
Page should connectio
be n should 3 Enter user should be able
present be username to input username
if user present and and password
logs User password
out should be 4 Click on Home page should
and logged in login be displayed after
logs in button login and user name
again. should be displayed
on home page
5 Click on User profile should
user be displayed.
name
displayed
on home
page.
6 Click on The product page
any should be
product displayed.
displayed
on home
page
7 Click on The product should
add to be added to cart.
cart for
the
product.
8 Click on User is logged out.
Logut
button
9 Login The user should be
again logged in and the
with items shold be
same present in cart.
userid
password

CHECK OUT ,PAYMENT

Test Module Test Test Pre- Test Data Step Test Step Expected Result Actual Status Defec
Case Name Scenari Case requisites No. Result t ID
ID o
TC0 Checko Verify Verify Browser Username 1 Open Browser should be
01 ut,Paym the that should be - browser opened
ents details payme installed Username 2 Open url Ecommerce
Page on nts Internet Password- website should be
Checko options connecti password opened
ut,Paym applica on 3 Enter user should be able
ents ble for should be username to input username
Page the present and and password
order password
should
be 4 Click on Home page should
display login be displayed after
ed at button login
checko
ut.
5 Click on The product page
any should be
product displayed.
displayed
on home
page
6 Click on The product should
add to be added to cart.
cart for
the
product.
7 Click on The checkout page
Checkout should be
button. displayed with
payments options.

TC0 Checko Verify Verify Browser 1 Open Browser should be


02 ut,Paym the that should be browser opened
ents details deliver installed 2 Open url Ecommerce
Page on y Internet website should be
Checko details connecti opened
ut,Paym of on
ents items should be
Page should present 3 Enter user should be able
be User username to input username
display should be and and password
ed at logged in password
checko
ut. 4 Click on Home page should
login be displayed after
button login and user
name should be
displayed on home
page

5 Click on The product page


any should be
product displayed.
displayed
on home
page
6 Click on The product should
add to be added to cart.
cart for
the
product.
7 Click on The checkout page
Checkout should be
button. displayed with
delivery details.

TC0 Checko Verify Verify Browser 1 Open Browser should be


03 ut,Paym the that should be browser opened
ents details user installed 2 Open url Ecommerce
Page on should Internet website should be
Checko get connecti opened
ut,Paym order on
ents details should be
Page by present 3 Enter user should be able
messag User username to input username
e or should be and and password
email. logged in password

4 Click on Home page should


login be displayed after
button login and user
name should be
displayed on home
page

5 Click on The product page


any should be
product displayed.
displayed
on home
page
6 Click on The product should
add to be added to cart.
cart for
the
product.
7 Click on The checkout page
Checkout should be
button. displayed with
payments options.

8 Make User should get


payment order details by
for the message or email.
order.

TC0 Checko Verify Verify Browser 1 Open Browser should be


04 ut,Paym the that should be browser opened
ents details user installed 2 Open url Ecommerce
Page on should Internet website should be
Checko be connecti opened
ut,Paym directe on
ents d to should be
Page home present 3 Enter user should be able
page User username to input username
after should be and and password
checko logged in password
ut.
4 Click on User should be
login logged in and
button Search
functionality is
present on home
page.
5 Click on The product page
any should be
product displayed.
displayed
on home
page
6 Click on The product should
add to be added to cart.
cart for
the
product.
7 Click on The checkout page
Checkout should be
button. displayed with
payments options.

8 Make Ther order should


payment be confirmed and
for the user should be
order. directed to home
page.

TC0 Checko Verify Verify Browser 1 Open Browser should be


05 ut,Paym the that should be browser opened
ents details user installed 2 Open url Ecommerce
Page on should Internet website should be
Checko be connecti opened
ut,Paym display on
ents ed should be
Page payme present 3 Enter user should be able
nt User username to input username
options should be and and password
such as logged in password
Credit
Card, 4 Click on User should be
Debit login logged in and home
Card, button page should be
Net same on different
Bankin browsers.
g etc.

5 Click on The product page


any should be
product displayed.
displayed
on home
page
6 Click on The product should
add to be added to cart.
cart for
the
product.
7 Click on The checkout page
Checkout should be
button. displayed with
payments options
such as debit card,
credit card,
netbanking etc.
TC0 Checko Verify Verify Browser 1 Open Browser should be
06 ut,Paym the that if should be browser opened
ents details user is installed 2 Open url Ecommerce
Page on not Internet website should be
Checko registe connecti opened
ut,Paym red on
ents then should be
Page payme present 3 Click on The product page
nt User any should be
should should be product displayed.
be logged in displayed
done on home
as page
Guest 4 Click on The product should
user. add to be added to cart.
cart for
the
product.
5 Click on The checkout page
Checkout should be
button. displayed with
payments options.

6 Make The payment


payment should be done as
for the guest user.
order.

TC0 Checko Verify Verify Browser 1 Open Browser should be


07 ut,Paym the that should be browser opened
ents details user installed 2 Open url Ecommerce
Page on should Internet website should be
Checko be connecti opened
ut,Paym provid on
ents ed should be
Page with present 3 Enter user should be able
an User username to input username
option should be and and password
to save logged in password
the 4 Click on Home page should
payme login be displayed after
nt button login and user
metho name should be
d. displayed on home
page

5 Click on User should be


any redirected to
product product
displayed specification page.
on home
page
6 Click on The product page
any should be
product displayed.
displayed
on home
page
7 Click on The product should
add to be added to cart.
cart for
the
product.
8 Click on The checkout page
Checkout should be
button. displayed with
payments options.

9 Make the user should be


payment able to save
for the payment method
order. for future orders.

TC0 Checko Verify Verify Browser 1 Open Browser should be


08 ut,Paym the that should be browser opened
ents details session installed 2 Open url Ecommerce
Page on should Internet website should be
Checko be connecti opened
ut,Paym timed on
ents out if should be
Page payme present 3 Enter user should be able
nt is User username to input username
not should be and and password
done logged in password
for a
certain 4 Click on Home page should
time. login be displayed after
button login and user
name should be
displayed on home
page
5 Click on User should be
any redirected to
product product
displayed specification page.
on home
page
6 Click on The product page
any should be
product displayed.
displayed
on home
page
7 Click on The product should
add to be added to cart.
cart for
the
product.
8 Click on The checkout page
Checkout should be
button. displayed with
payments options.

9 Select Payment page


payment should be
method displayed.
and click
on pay.
10 Stay on The payment
payment session should be
page for timedout.
long time
wtihout
any
activity.
TC0 Checko Verify Verify Browser 1 Open Browser should be
09 ut,Paym the that should be browser opened
ents details user installed 2 Open url Ecommerce
Page on details Internet website should be
Checko should connecti opened
ut,Paym be on
ents display should be
Page ed on present 3 Enter user should be able
payme User username to input username
nt page should be and and password
for logged in password
registe
red 4 Click on Home page should
custom login be displayed after
ers. button login and user
name should be
displayed on home
page
5 Click on User profile should
user be displayed.
name
displayed
on home
page.
6 Click on The product page
any should be
product displayed.
displayed
on home
page
7 Click on The product should
add to be added to cart.
cart for
the
product.
8 Click on The checkout page
Checkout should be
button. displayed with user
details.

TC0 Checko Verify Verify Browser 1 Open Browser should be


010 ut,Paym the that on should be browser opened
ents details succes installed 2 Open url Ecommerce
Page on sful Internet website should be
Checko payme connecti opened
ut,Paym nt on
ents email should be
Page or text present 3 Enter user should be able
messag User username to input username
e should be and and password
should logged in password
be
deliver 4 Click on Used should be
ed to login logged in and home
custom button page should be
er displayed, products
along should be
with categorised.
unique
order 5 Click on The product page
numbe any should be
r. product displayed.
displayed
on home
page
6 Click on The product should
add to be added to cart.
cart for
the
product.
7 Click on The checkout page
Checkout should be
button. displayed with
payments options.

8 Make Order should be


payment. confirmed and
email or text
message should be
delivered to
customer.

MY ORDER PAGE

Test Module Test Test Pre- Test Data Step Test Step Expected Result Actual Status Defec
Case Name Scenari Case requisites No. Result t ID
ID o
TC0 My Verify Verify Browser Username 1 Open Browser should be
01 Orders the that should be - browser opened
Page details user installed Username 2 Open url Ecommerce
on should Internet Password- website should be
Orders be able connecti password opened
Page to on 3 Enter user should be able
track should be username to input username
the present and and password
order password
on My 4 Click on Home page should
orders login be displayed after
page. button login
5 Click on The orders by user
My should be
orders displayed.
button
6 Click on Tracking
Track information should
order for be displayed for
a order. that order.
TC0 My Verify Verify Browser 1 Open Browser should be
02 Orders the that should be browser opened
Page details user installed 2 Open url Ecommerce
on should Internet website should be
Orders be able connecti opened
Page to on 3 Enter user should be able
change should be username to input username
the present and and password
deliver User password
y date should be 4 Click on Home page should
and logged in login be displayed after
time. button login and user
name should be
displayed on home
page
5 Click on The orders by user
My should be
orders displayed.
button
6 Click on The user should be
change provided details for
delivery selecting delivery
date and date and time.
time
button.
TC0 My Verify Verify Browser 1 Open Browser should be
03 Orders the that should be browser opened
Page details user installed 2 Open url Ecommerce
on should Internet website should be
Orders be able connecti opened
Page to on 3 Enter user should be able
cancel should be username to input username
the present and and password
order User password
should be 4 Click on Home page should
logged in login be displayed after
button login and user
name should be
displayed on home
page
5 Click on The orders by user
My should be
orders displayed.
button
6 Click on User should be able
cancel to cancel the order.
order for
an order.
TC0 My Verify Verify Browser 1 Open Browser should be
04 Orders the that should be browser opened
Page details user installed 2 Open url Ecommerce
on should Internet website should be
Orders be able connecti opened
Page to on 3 Enter user should be able
return should be username to input username
the present and and password
order User password
after should be 4 Click on User should be
deliver logged in login logged in and
y of button Search
order. functionality is
present on home
page.
5 Click on The orders by user
My should be
orders displayed.
button
6 Click on User should be
return provided with
item for pickup date and
an order. time for return.
TC0 My Verify Verify Browser 1 Open Browser should be
05 Orders the that should be browser opened
Page details user installed 2 Open url Ecommerce
on should Internet website should be
Orders be able connecti opened
Page to on 3 Enter user should be able
exchan should be username to input username
ge the present and and password
order User password
from should be 4 Click on User should be
My logged in login logged in and home
orders button page should be
page. same on different
browsers.
5 Click on The orders by user
My should be
orders displayed.
button
6 Click on User should be
exchange given details of
item for exchange item .
an order.
TC0 My Verify Verify Browser 1 Open Browser should be
06 Orders the that should be browser opened
Page details user installed 2 Open url Ecommerce
on should Internet website should be
Orders be able connecti opened
Page to on 3 Enter user should be able
provid should be username to input username
e feed present and and password
back User password
and should be 4 Click on User should be
review logged in login logged in and
s about button alignment of
the products on home
item page should be
deliver proper.
ed. 5 Click on The orders by user
My should be
orders displayed.
button
6 Click on User can write
Write review and provide
review feedback.
button
for an
item.
CUSTOMER SERVICE PAGE

Test Modul Test Test Pre- Test Data Step Test Expected Result Actual Status De
Case e Scenario Case requisites No. Step Result fe
ID Name ct
ID
TC0 Custo Verify Verify Browser Usernam 1 Open Browser should be
01 mer the that should be e- browser opened
Servic details on customer installed Usernam 2 Open Ecommerce website
e Page Custome service Internet e url should be opened
r Service options connecti Password
Page should be on - 3 Enter user should be able to
present should be password usernam input username and
on the present e and password
website. passwor
d
4 Click on Home page should be
login displayed after login
button
5 Click on Customer care page
contact is displayed.
custome
r care
button.
TC0 Custo Verify Verify Browser 1 Open Browser should be
02 mer the that should be browser opened
Servic details on different installed 2 Open Ecommerce website
e Page Custome modes of Internet url should be opened
r Service customer connecti
Page service on 3 Enter user should be able to
such as should be usernam input username and
Email, present e and password
Chat or User passwor
Call should be d
should be logged in 4 Click on Home page should be
mentione login displayed after login
d. button and user name should
be displayed on home
page
5 Click on Customer care page
contact is displayed with
custome different modes of
r care customer service
button. such as Email,chat or
call.
TC0 Custo Verify Verify Browser 1 Open Browser should be
03 mer the that should be browser opened
Servic details on waiting installed 2 Open Ecommerce website
e Page Custome time to Internet url should be opened
r Service connect connecti
Page to on 3 Enter user should be able to
customer should be usernam input username and
e and password
service present passwor
shold be User d
displayed should be
to user. logged in 4 Click on Home page should be
login displayed after login
button and user name should
be displayed on home
page
5 Click on Customer care page
contact is displayed with
custome different modes of
r care customer service
button. such as Email,chat or
call.
6 Select Waiting time is
any displayed for that
mode of customer service.
custome
r
service.
TC0 Custo Verify Verify Browser 1 Open Browser should be
04 mer the that should be browser opened
Servic details on customer installed 2 Open Ecommerce website
e Page Custome service Internet url should be opened
r Service should be connecti
Page available on 3 Enter user should be able to
in should be usernam input username and
different present e and password
language User passwor
s. should be d
logged in 4 Click on User should be
login logged in and Search
button functionality is
present on home
page.
5 Click on Customer care page
contact is displayed with
custome different available
r care languages.
button.
TC0 Custo Verify Verify Browser 1 Open Browser should be
05 mer the that the should be browser opened
Servic details on timings installed 2 Open Ecommerce website
e Page Custome of Internet url should be opened
r Service customer connecti
Page service on 3 Enter user should be able to
option should be usernam input username and
should be present e and password
displayed User passwor
to user. should be d
logged in 4 Click on User should be
login logged in and home
button page should be same
on different browsers.
5 Click on Customer care page
contact is displayed with
custome timings of different
r care modes of customer
button. care.

RESULT:
EX NO : 4 DEVELOP THE TEST PLAN AND DESIGN THE TEST CASES FOR

AN INVENTORY CONTROL SYSTEM

AIM:

Test Plan for an Inventory Control System


1. Introduction
The Inventory Control System is designed to efficiently manage inventory, track stock levels, and ensure
accurate stock information. This test plan outlines the testing approach, scope, objectives, and methodologies to
verify the functionality, performance, and usability of the system.
2. Objectives
The primary objectives of this test plan are to:

Validate that the Inventory Control System meets the functional requirements.
Verify the accuracy and consistency of inventory tracking.
Assess system performance under varying loads.
Ensure the system's security mechanisms are effective.
Evaluate the system's usability and user-friendliness.
3. Test Scope
The testing will cover the following aspects of the Inventory Control System:

User authentication and authorization.


Adding, updating, and deleting products in the inventory.
Monitoring stock levels and receiving alerts for low stock.
Generating various inventory reports.
User interfaces for different user roles (admin, manager, employee).
4. Test Environment

Hardware: Servers, workstations, mobile devices for testing different platforms.


Software: Inventory Control System build, web browsers, databases.
Network: LAN/WAN with various network conditions (latency, bandwidth).
Test Data: Realistic inventory data and user scenarios for testing.

5. Test Data

Test data will include a range of products, quantities, prices, and suppliers.
Both normal and boundary test cases will be created to cover various scenarios.
Data will be structured to validate different calculations and reports.

6. Test Cases
A comprehensive list of test cases will be created for functional, performance, security, and usability testing.
Each test case will include:
Test case ID
Description of the scenario
Preconditions
Steps to execute the test
Expected results
Actual results
Pass/fail status

7. Types of Testing

Unit Testing: Testing individual modules and functions.


Integration Testing: Testing interactions between different system components.
Functional Testing: Validating functional requirements.
Performance Testing: Evaluating system response times and resource usage.
Security Testing: Checking for vulnerabilities and unauthorized access.
Usability Testing: Assessing user-friendliness and navigation.

8. Test Schedule
Testing Phases and Estimated Timeline:
Unit Testing: 1 week
Integration Testing: 2 weeks
Functional Testing: 2 weeks
Performance Testing: 1 week
Security Testing: 1 week
Usability Testing: 1 week

9. Defect Management

Defects will be logged using a defect tracking tool.


Defects will be classified by severity (critical, major, minor) and priority.
Defects will be retested after resolution.

10. Risk Assessment

Identified risks include data loss, system downtime, security breaches.


Mitigation strategies include regular data backups, redundancy, security protocols.

11. Test Deliverables


Test cases document
Test execution results and defect reports
Performance testing results and analysis
Usability testing observations and feedback
12. Resources

Test Manager: Responsible for overall test coordination.


Testers: Responsible for test execution, logging defects, and retesting.

13. Exit Criteria

All high-priority defects are resolved.


Key performance indicators meet predefined targets.
All test cases are executed and passed.

14. Approval
This test plan requires approval from relevant stakeholders before testing commences.

15. Appendix

Glossary of terms
References used in the test plan
TEST CASES FOR INVENTORY MANAGEMENT SYSTEM

Sr.No Testcases Action Steps Input Data Experienced Actual status


result result
1 TC−1 Invoice Enter Input*1021* It should
no Invoice accepted
no invoice no.
2 TC−2 Bill date Enter Bill Input*27/11/2021* It should
date accepted bill
date
3 TC−3 Item select − Item name
name Item should be
name automatically
reflected
4 TC−4 Available Click on − It should
item text box reflect
stock automatically
item stock
5 TC−5 Quantity Enter Input*5000* Item quantity
item should be
quantity accepted
6 TC−6 Price Click on − Price should
text box be reflected
automatically
7 TC−7 Total Click on − Total should
text box be reflected
automatically
8 TC−8 Receive Enter Input*29/1/2021 Receive bill
bill date receive date should
bill date be accepting
9 TC−9 Add item Click on − It should be
add item add item
reflecting in
database

RESULT:
EX NO: 5 EXECUTE THE TEST CASES AGAINST A CLIENT SERVER OR
DESKTOP APPLICATION AND IDENTIFY THE DEFECTS.

AIM:

Program:
1. html:

<html>
<head>
<title>JavascriptLoginFormValidation</title>
<!--IncludeCSSFileHere-->
<linkrel="stylesheet"href="form-style.css"/>
<!--IncludeJSFileHere -->
<scriptsrc="login.js"></script>
</head>
<body>
<divclass="container">
<divclass="main">
<h2>JavascriptLoginFormValidation</h2>
<formid="form_id"method="post"name="myform">
<label>UserName:</label>
<inputtype="text"name="username"id="username"/>
<label>Password:</label>
<inputtype="password"name="password"id="password"/>
<inputtype="button"value="Login"id="submit"onclick="validate()"/>
</form>
<span><bclass="note">Note:</b>For this demousefollowingusernameand password.
<br/><bclass="valid">UserName: Form<br/>Password:123</b></span>
</div>
</div>
</body>
</html>
login.js:
varattempt =3; //Variable tocount numberofattempts.
//BelowfunctionExecutesonclickofloginbutton.functio
nvalidate(){ varusername=document.getElementById("username")
.value;varp
assword=document.getElementById("password").value;

if(username=="Form"&&password=="123"){alert("
Login successfully");
window.location="success.html";//Redirectingtootherpage.returnf
alse;
}
else{
attempt --; // Decrementing by one.
Ialert("Youhaveleft"+attempt+"attempt;");
// Disabling fields after 3
attempts.if(attempt ==0){
document.getElementById("username").disabled=true;doc
ument.getElementById("password").disabled =
true;document.getElementById("submit").disabled =
true;returnfalse;
}
}
}
success.html:
<html>
<head>
<title>JavascriptLoginFormValidation</title>
</head>
<body>
<h2>SuccessfulLogin!</h2>
</body>
</html>

RESULT:
Ex.No:6 TEST THE PERFORMANCE OF THE E-COMMERCE APPLICATION

AIM:

E-Commerce applications are designed in such a way that customers can easily make purchases at any
time of the day, irrespective of where they are located. If an eCommerce application malfunctions
during peak hours, not only will it cause customer dissatisfaction, but it will also lead to revenue loss
for the business.

To avoid such situations, companies can invest in performance testing of eCommerce applications
that focuses on issues related to speed, stability, and scalability. Hence, in the wake of increasing
demand for online shopping, it is necessary to do performance testing of the eCommerce application
and toensure that the application is stable and scalable enough to serve all customer requirements.

Goals of E-Commerce Performance Testing


Performance testing is carried out on eCommerce software to ensure that the platform is
functioning as expected. Let's explore why eCommerce application performance testing is important
and how it affects the app's overall quality:

 Reduce Risks: Many times, making major and considerable changes to a site can cause
notable strategic changes or even trigger significant losses. However, testing these changes
in a planned manner can help eliminate the chances of these uncertain revenue losses
.
 Increase Conversion Rates: By testing every aspect of an application and ensuring a smooth
visitor experience through site optimization, the application conversion rate is bound to increase.

 Improve User Engagement: Testing tells which page element or process affects a user’s onsite
journey and helps in rectifying the issues faster. The better the user experience, the greater the
onsite engagement.

Benefits of E-Commerce Application Performance Testing


Performance testing, when done effectively and consistently, can greatly boost conversions
while also enhancing the overall experience of site users. The following reasons explain the
significance of testing and optimization:

 Coupon codes or gift vouchers are provided to increase product sales and performance tests
ensure that coupon codes work well when applied to users in bulk.
 Multiple systems like email servers, social network sites, and enterprise content management
systems are involved in the backend and the performance test ensures flawless functioning of
various features like product images/videos, and social media in such an integrated system.

 eCommerce applications usually have more users than any other application and validation of
users is a must to filter out genuine customers. Performance test helps in validating multiple
sign-up and invoice email notifications in parallel.

 Augmented Reality (AR) is an advanced-level feature provided by modern eCommerce


websites so that customers can feel better without seeing products in person. With
augmented reality performance testing, we can make the feature more efficient and pleasing to
the eye.

 A recommendation system is a program that generates online recommendations using


several algorithms, artificial intelligence, and data analysis. A well-designed recommendation
system helps in better customer acquisition and retention. It is developed for both new and
existingcustomerswith different behavior for different customer types. Performance
testing helps in making the recommendation system a faster system, to retain online shoppers.

 Chatbots interact with online shoppers to improve the user experience, and any delay in
providing the required information may switch users to a competitor's application.
Performance tests speed up chatbots to answer customer queries.

 Reviews are very important to increase the sale of a product. The majority of users prefer
visiting the review listing page to get instant user feedback. Performance test helps in
optimizing customer review listing load time.

 eCommerce applications attract the maximum number of customers during annual sales
events. Backend servers should be set with the optimal settings, keeping future users’ traffic
in mind. Performance tests help in identifying the servers’ optimum locations to manage
a higher number of users.

Common Performance Testing Issues


Some common challenges faced in implementing performance testing are as follows:
 Slow DB server: Database size increases with the increase in product items of all ages,
so ensure to optimize DB queries.

 Faster Integrated Systems Communication: Multiple systems like email servers, social media
accounts, and payment channels are involved in the functioning of an
eCommerce application to ensure that integrated systems work well under a heavy load
.
 System Scaling: Brands cannot predict user load during peak hours, hence, the need of the
hour is to be ready with tested scalable systems.
 Immoderate Scripts: Few eCommerce applications are associated with third-party scripts
that are running in the background like Google Analytics and Ads, and these widgets
can be a significant contributor to page load time.

 Slow Servers: Server resources and applications should be optimized to deliver content as
quickly as possible after addressing any content-related performance issues.
 Massive Media: Oftentimes, images, videos, and other media are uploaded by
non-technical employees that aren't familiar with the impact of loaded heavy files.
It's important to ensure these assets are optimized to maximize performance

Main Features to be Tested in E-Commerce Applications


Your eCommerce website's success depends on choosing the features to test to ensure that
it performs flawlessly. Some of the major features that require testing are as follows:
 Searching For a Product: eCommerce sites provide various search filters to make the
search experience faster, which include price range, product type, country, and age. Hence,
ensure that searching for a product among billions of records does not halt the system
and return the expected records.
 Virtual Reality: Modern eCommerce sites provide advanced-level features to visualize
products. Online shoppers can now see how they would look wearing an item virtually
Hence, we need toensure the smooth movement of virtual images for a better experience.

 Testing Payment Gateway Integration: Failed transactions are one of the main reasons
why most customers exit an application without completing the purchase.
So it's important to ensure the proper functioning of payment gateways.

 Product Details Page: A fast product listing is important because every consumer will be
attracted to the product by how it's presented and how it's visible to them.

Best Practices for Performance Testing


Mentioned below are some of the best practices for testing eCommerce applications:
 Test all CDNs (content delivery networks) by repeating time-bound hot transactions multiple times.
 Performance testing of big data plays an important role to ensure faster decompression
and compression cycles to speed up the application’s speed.
 Online shopping has opened doors worldwide for businesses. Vendors shifted their servers
to the cloud for better user coverage. Hence, tests from various geo-locations need to be
performed to identify latency issues and to ensure that the geographical location of a user
does not affect the speed of the application.
 Test individual servers before integration system testing to find bottlenecks like email servers,
social accounts, DB servers, and enterprise content management systems.
 Volume testing plays a crucial role in seeing how storage systems function with or without a heavy
load, hence including it in the test scope is a good practice.

Role of QASource
Testing experts at QASource have years of experience in running performance tests on a wide range
of domains including eCommerce, media streaming, legal, human resources, eLearning, healthcare
, enterprise content management, financial, and many more. QASource assists teams in setting
up the performance test lab and identifying the best-fit performance test scenarios to ensure the
best user experience. Following are our high-level performance testing services to meet the performance
test requirement:
 Performance test plan
 Test data setup
 Simulation of test cases
 Generate performance test suite results
 Identify bottlenecks and follow up with the Dev team to fix them
 Generate daily status reports
Conclusion
Performance testing of eCommerce applications is a crucial part of any business's success.
It helps eCommerce applications generate better user experience, safeguard user data security, and
ensure mobile responsiveness, security, and a quick load time. It is vital to conduct quick and
effective application performance testing from time to time to ensure that the application is
offering an exceptional customer experience to maximize revenue for businesses

RESULT:
EX NO: 7 AUTOMATE THE TESTING OF E-COMMERCE APPPLICATIONS

USING SELEINIUM

AIM:

Positive Scenario

1. Test Case - Automate the User Registration process of an e-commerce website.

Steps to Automate:
1. Open this URL http://automationpractice.com/index.php
2. Click on the sign-in link.
3. Enter your email address in the 'Create and Account' section.
4. Click on Create an Account button.
5. Enter your Personal Information, Address, and Contact info.
6. Click on the Register button.
7. Validate that the user is created.

Selenium code for User Registration:

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;
import io.github.bonigarcia.wdm.WebDriverManager;
public class EcomSignUp {
public static void main(String[] args)
{ WebDriverManager.chromedriver().setup
();WebDriver driver=new ChromeDriver();
String URL="http://automationpractice.com/index.php";

driver.get(URL);
driver.manage().timeouts().implicitlyWait(2000, TimeUnit.MILLISECONDS);
driver.manage().window().maximize();
//Click on Sign in
driver.findElement(By.linkText("Sign in")).click();
//Enter email address
driver.findElement(By.cssSelector("[name='email_create']")).sendKeys("[email protected]");
//Click on "Create an account"
driver.findElement(By.xpath("//button[@name=\"SubmitCreate\"]")).click();
//Select Title
driver.findElement(By.xpath("//input[@id=\"id_gender1\"]")).click();
driver.findElement(By.name("customer_firstname")).sendKeys("Test User");
driver.findElement(By.name("customer_lastname")).sendKeys("Vsoft");
driver.findElement(By.id("passwd")).sendKeys("PKR@PKR");
// Enter your address
driver.findElement(By.id("firstname")).sendKeys("Test User");
driver.findElement(By.id("lastname")).sendKeys("Vsoft");
driver.findElement(By.id("company")).sendKeys("Vsoft");
driver.findElement(By.id("address1")).sendKeys("Test 81/1,2nd cross");
driver.findElement(By.id("city")).sendKeys("XYZ");
// Select State
WebElement statedropdown=driver.findElement(By.name("id_state"));
Select oSelect=new Select(statedropdown);
oSelect.selectByValue("4");
driver.findElement(By.name("postcode")).sendKeys("51838");
// Select Country
WebElement countrydropDown=driver.findElement(By.name("id_country"));
Select oSelectC=new Select(countrydropDown);
oSelectC.selectByVisibleText("United States");
//Enter Mobile Number
driver.findElement(By.id("phone_mobile")).sendKeys("234567890");
driver.findElement(By.xpath("//input[@name=\"alias\"]")).clear();
driver.findElement(By.xpath("//input[@name=\"alias\"]")).sendKeys("Office");
driver.findElement(By.name("submitAccount")).click();
String userText=driver.findElement(By.xpath("//*[@id=\"header\"]/div[2]/div/div/nav/div[1]/a")).getText();
// Validate that user has created
if(userText.contains("Vsoft"))
{ System.out.println("User Verified,Test case
Passed");
}
else {
System.out.println("User Verification Failed,Test case Failed");
}
}}

Negative Scenarios

2. Test Case - Verify invalid email address error.


Steps to Automate:
1. Open this URL http://automationpractice.com/index.php
2. Click on the sign-in link.
3. Enter an invalid email address in the email box and click enter.
4. Validate that an error message is displaying saying "Invalid email address."

3. Test Case - Verify error messages for mandatory fields.

Steps to Automate:
1. Open this URL http://automationpractice.com/index.php
2. Click on the sign-in link.
3. Enter your email address and click the Register button.
4. Leave the mandatory fields (marked with *) blank and click the Register button.
5. Verify that an error has been displayed for the mandatory fields.

4. Test Case - Verify error messages for entering incorrect values in fields.

Steps to Automate:
1. Open this URL http://automationpractice.com/index.php
2. Click on the sign-in link.
3. Enter your email address and click the Register button.
4. Enter incorrect values in fields like., enter numbers in first and last name, city field, etc., and enter
alphabets in Mobile no, Zip postal code, etc., and click on the 'Register' button.
5. Verify that error messages for respective fields are displaying.
Try automating the above scenarios using Selenium commands, if you face any difficulty please refer to the
Selenium Tutorial series.

5. Automate the 'Search Product' feature of Amazon like e-commerce website with Selenium

1. Test Case - Automate the 'Search Product' feature of the e-commerce website with Selenium.

Steps to Automate:
1. Open link http://automationpractice.com/index.php
2. Move your cursor over the Women's link.
3. Click on the sub-menu 'T-shirts'
4. Get the Name/Text of the first product displayed on the page.
5. Now enter the same product name in the search bar present at the top of the page and click the search
button.
6. Validate that the same product is displayed on the searched page with the same details which were
displayed on T-Shirt's page.
Automation Code for Product Search:

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import io.github.bonigarcia.wdm.WebDriverManager;
public class EcomPractice2 {
public static void main(String[] args) throws
InterruptedException{WebDriverManager.chromedriver().setup();
WebDriver driver=new ChromeDriver();
String URL="http://automationpractice.com/index.php";
driver.get(URL);
driver.manage().window().maximize();
// Initialise Actions class object
Actions actions=new Actions(driver);
driver.manage().timeouts().implicitlyWait(2000, TimeUnit.MILLISECONDS);
WebElement womenTab=driver.findElement(By.linkText("WOMEN"));
WebElement
TshirtTab=driver.findElement(By.xpath("//div[@id='block_top_menu']/ul/li[1]/ul/li[1]/ul//a[@title='T-
shirts']"));
actions.moveToElement(womenTab).moveToElement(TshirtTab).click().perform();
Thread.sleep(2000);
// Get Product Name
String
ProductName=driver.findElement(By.xpath("/html[1]/body[1]/div[1]/div[2]/div[1]/div[3]/div[2]/ul[1]/li[1]/di
v[1]/div[2]/h5[1]/a[1]")).getText();
System.out.println(ProductName);
driver.findElement(By.id("search_query_top")).sendKeys(ProductName);
driver.findElement(By.name("submit_search")).click();
// Get Name of Searched Product
String
SearchResultProductname=driver.findElement(By.xpath("/html[1]/body[1]/div[1]/div[2]/div[1]/div[3]/div[2]/
ul[1]/li[1]/div[1]/div[2]/h5[1]/a[1]")).getText();
// Verify that correct Product is displaying after search
if(ProductName.equalsIgnoreCase(SearchResultProductname))
{System.out.println("Results Matched;Test Case Passed");
}else{
System.out.println("Results NotMatched;Test Case Failed");
}
// Close the browser
driver.close();
}
}

6. Automate the 'Buy Product' feature of Amazon like an e-commerce website with Selenium

The most important function of an e-commerce website is buying a product, which includes various steps
like selecting a product, selecting size/color, adding to the cart, checkout, etc. You will find every test
scenario along with the automation code in the following section.

1. Test Case - Automate the end-to-end "Buy Product" feature of the e-commerce website.

Steps to Automate:
1. Open link http://automationpractice.com/index.php
2. log in to the website.
3. Move your cursor over the Women's link.
4. Click on the sub-menu 'T-shirts'.
5. Mouse hover on the second product displayed.
6. 'More' button will be displayed, click on the 'More' button.
7. Increase quantity to 2.
8. Select size 'L'
9. Select color.
10. Click the 'Add to Cart' button.
11. Click the 'Proceed to checkout' button.
12. Complete the buy order process till payment.
13. Make sure that the Product is ordered.

Automation code for Buy product

import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.Select;
import io.github.bonigarcia.wdm.WebDriverManager;
public class EcomExpert {
public static void main(String[]
args){ WebDriverManager.chromedriver().
setup();WebDriver driver=new
ChromeDriver();
String URL="http://automationpractice.com/index.php";

// Open URL and Maximize browser window


driver.get(URL);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(3000, TimeUnit.MILLISECONDS);
//Click on Sign in
driver.findElement(By.linkText("Sign in")).click();
//Login
driver.findElement(By.id("email")).sendKeys("[email protected]");
driver.findElement(By.id("passwd")).sendKeys("PKR@PKR");
driver.findElement(By.id("SubmitLogin")).click();
//Click on Women
driver.findElement(By.linkText("WOMEN")).click();
WebElement
SecondImg=driver.findElement(By.xpath("/html/body/div[1]/div[2]/div/div[3]/div[2]/ul/li[2]/div/div[1]/div/a[ 1]/i
mg"));
WebElement
MoreBtn=driver.findElement(By.xpath("/html/body[1]/div[1]/div[2]/div[1]/div[3]/div[2]/ul/li[2]/div[1]/div[2]
/div[2]/a[2]"));
Actions actions=new Actions(driver);
actions.moveToElement(SecondImg).moveToElement(MoreBtn).click().perform();
//Change quantity by 2
driver.findElement(By.id( "quantity_wanted" )).clear();
driver.findElement(By.id( "quantity_wanted" )).sendKeys("2");
//Select size as L
WebElement Sizedrpdwn=driver.findElement(By.xpath("//*[@id='group_1']"));
Select oSelect=new Select(Sizedrpdwn);
oSelect.selectByVisibleText("M");
//Select Color
driver.findElement(By.id("color_11")).click();
//Click on add to cart
driver.findElement(By.xpath("//p[@id='add_to_cart']//span[.='Add to cart']")).click();
//Click on proceed
driver.findElement(By.xpath("/html//div[@id='layer_cart']//a[@title='Proceed to checkout']/span")).click();
//Checkout page Proceed
driver.findElement(By.xpath("/html/body/div[1]/div[2]/div/div[3]/div/p[2]/a[1]/span")).click();
driver.findElement(By.xpath("/html/body/div[1]/div[2]/div/div[3]/div/form/p/button/span")).click();
//Agree terms&Conditions
driver.findElement(By.xpath("//*[@id=\"cgv\"]")).click();
driver.findElement(By.xpath("/html/body/div[1]/div[2]/div/div[3]/div/div/form/p/button/span")).click();
//Click on Payby Check
driver.findElement(By.xpath("/html/body/div[1]/div[2]/div/div[3]/div/div/div[3]/div[2]/div/p/a")).click();
//Confirm the order
driver.findElement(By.xpath("/html/body/div[1]/div[2]/div/div[3]/div/form/p/button/span")).click();
//Get Text
String ConfirmationText=driver.findElement(By.xpath("//div[@id='center_column']/p[@class='alert alert-
success']")).getText();
// Verify that Product is ordered
if(ConfirmationText.contains("complete"))
{ System.out.println("Order Completed: Test Case Passed");
}
else {
System.out.println("Order Not Successfull: Test Case Failed");
}

}
}

2. Test Case - Verify that 'Add to Wishlist' only works after login.

Steps to Automate:
1. Open link http://automationpractice.com/index.php
2. Move your cursor over the Women's link.
3. Click on the sub-menu 'T-shirts'.
4. Mouse hover on the second product displayed.
5. 'Add to Wishlist' will appear on the bottom of that product, click on it.
6. Verify that the error message is displayed 'You must be logged in to manage your wish list.'

3. Test Case - Verify that Total Price is reflecting correctly if the user changes quantity on the
'Shopping Cart Summary' Page.

Steps to Automate:
1. Open link http://automationpractice.com/index.php
2. Log in to the website.
3. Move your cursor over the Women's link.
4. Click on the sub-menu 'T-shirts'.
5. Mouse hover on the second product displayed.
6. 'More' button will be displayed, click on the 'More' button.
7. Make sure the quantity is set to 1.
8. Select size 'M'
9. Select the color of your choice.
10. Click the 'Add to Cart' button.
11. Click the 'Proceed to checkout' button.
12. Change the quantity to 2.
13. Verify that the Total price is changing and reflecting the correct price.

RESULT:
EX.NO:8 INTEGRATE TestNG WITH THE ABOVE TEST AUTOMATION

AIM:

TestNG is a powerful testing framework, an enhanced version of JUnit which was in use for a long time
before TestNG came into existence. NG stands for 'Next Generation'.

TestNG framework provides the following features −

 Annotations help us organize the tests easily.


 Flexible test configuration.
 Test cases can be grouped more easily.
 Parallelization of tests can be achieved using TestNG.
 Support for data-driven testing.
 Inbuilt reporting.
Installing TestNG for Eclipse

Step 1 − Launch Eclipse and select 'Install New Software'.


Step 2 − Enter the URL as 'http://beust.com/eclipse' and click 'Add'.
Step 3 − The dialog box 'Add Repository' opens. Enter the name as 'TestNG' and click 'OK'

Step 4 − Click 'Select All' and 'TestNG' would be selected as shown in the figure.

Step 5 − Click 'Next' to continue.


Step 6 − Review the items that are selected and click 'Next'.
Step 7 − "Accept the License Agreement" and click 'Finish'.
Step 8 − TestNG starts installing and the progress would be shown follows.

Step 9 − Security Warning pops up as the validity of the software cannot be established. Click 'Ok'.
Step 10 − The Installer prompts to restart Eclipse for the changes to take effect. Click 'Yes'.

TestNG-Eclipse Setup

Step 1 − Launch Eclipse and create a 'New Java Project' as shown below.
Step 2 − Enter the project name and click 'Next'.
Step 3 − Navigate to "Libraries" Tab and Add the Selenium Remote Control Server JAR file by clicking on
"Add External JAR's" as shown below.

Step 4 − The added JAR file is shown here. Click 'Add Library'.
Step 5 − The 'Add Library' dialog opens. Select 'TestNG' and click 'Next' in the 'Add Library' dialog box.
Step 6 − The added 'TestNG' Library is added and it is displayed as shown below.
Step 7 − Upon creating the project, the structure of the project would be as shown below.
Step 8 − Right-click on 'src' folder and select New >> Other.
Step 9 − Select 'TestNG' and click 'Next'.

Step 10 − Select the 'Source Folder' name and click 'Ok'.


Step 11 − Select the 'Package name', the 'class name', and click 'Finish'.
Step 12 − The Package explorer and the created class would be displayed.

RESULT:
EXNO : 9 DEVELOP A MINI PROJECT

BUILD A DATA-DRIVEN FRAMEWORK USING SELENIUM and TestNG


BUILD PAGE OBJECT MODEL USING SELENIUM AND TestNG
BUILD BDD FRAMEWORK WITH SELENIUM,TestNG AND CUCUMBER

AIM:

Page Object Model (POM):

The Page Object model is an object design pattern in Selenium, where web pages are represented a classes,
the various elements on the page are defined as variables in the class and all possible user interaction can
then be implemented as methods in the class.
Cucumber:

Cucumber is one such open-source tool, which supports Behavior Driven Development(BDD). In simple
words, Cucumber can be defined as a testing framework, driven by plain English. It serves as documentation,
automated tests, and development aid – all in one.Dependency List

1. Cucumber Java – 7.14.0


2. Cucumber TestNG – 7.14.0
3. Java 11
4. Maven – 3.8.6
5. Selenium – 4.14.0
6. TestNG – 7.8.0
7. WebDriverManager – 5.5.3
Project
Structure
Implementation Steps
Step 1- Download and Install Java
Cucumber and Selenium need Java to be installed on the system to run the tests. Click here to learn
How to install Java.
Step 2 – Setup Maven
To build a test framework, we need to add a number of dependencies to the project. Click here to
learn How to install Maven.
Step 3 – Install Cucumber Eclipse Plugin (Only for Eclipse)
The cucumber plugin is an Eclipse plugin that allows eclipse to understand the Gherkin syntax.
When we are working with cucumber we will write the feature files that contain Feature, Scenario, Given,
When, Then, And, But, Tags, Scenario Outline, and Examples. By default, eclipse doesn’t understand
these keywords so it doesn’t show any syntax highlighter. Cucumber Eclipse Plugin highlights the
keywords present in Feature File. Refer to this tutorial to get more detail – How to setup Cucumber
with Eclipse.
Step 4 – Create a new Maven Project
To create a new Maven project, go to the File -> New Project-> Maven-> Maven project-> Next -> Enter
Group ID & Artifact ID -> Finish.
Click here to learn How to create a Maven project.
Step 5 – Create source folder src/test/resources to create test scenarios in the Feature file
A new Maven Project is created with 2 folders – src/main/java and src/test/java. To create test scenarios
, we need a new source folder called – src/test/resources. To create this folder, right-click on test directory
->select New ->Directory, and then it shows Maven Source Directories as resources as shown below.

Double-click on the resources directory and a new source directory under your new Maven project is
created as shown in the below image.
Step 6 – Add Selenium, TestNG, and Cucumber dependencies to the project
Add below mentioned Selenium, TestNG, and Cucumber dependencies to the project. I have added
WebDriverManager dependency to the POM.xml to download the driver binaries automatically. To know
more about this,
please refer to this tutorial – How to manage driver executables using WebDriverManager.
1 <properties>
2 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3 <cucumber.version>7.14.0</cucumber.version>
4 <selenium.version>4.14.0</selenium.version>
5 <webdrivermanager.version>5.5.3</webdrivermanager.version>
6 <testng.version>7.8.0</testng.version>
7 <apache.common.version>2.4</apache.common.version>
8 <maven.compiler.plugin.version>3.11.0</maven.compiler.plugin.version>
9 <maven.surefire.plugin.version>3.1.2</maven.surefire.plugin.version>
10 <maven.compiler.source.version>11</maven.compiler.source.version>
11 <maven.compiler.target.version>11</maven.compiler.target.version>
12 </properties>
13
14 <dependencies>
15
16 <dependency>
17 <groupId>io.cucumber</groupId>
18 <artifactId>cucumber-java</artifactId>
19 <version>${cucumber.version}</version>
20 </dependency>
21
22 <dependency>
23 <groupId>io.cucumber</groupId>
24 <artifactId>cucumber-testng</artifactId>
25 <version>${cucumber.version}</version>
26 <scope>test</scope>
27 </dependency>
28
29 <!-- Selenium -->
30 <dependency>
31 <groupId>org.seleniumhq.selenium</groupId>
32 <artifactId>selenium-java</artifactId>
33 <version>${selenium.version}</version>
34 </dependency>
35
36 <!-- Web Driver Manager -->
37 <dependency>
38 <groupId>io.github.bonigarcia</groupId>
39 <artifactId>webdrivermanager</artifactId>
40 <version>${webdrivermanager.version}</version>
41 </dependency>
42
43 <!-- TestNG -->
44 <dependency>
45 <groupId>org.testng</groupId>
46 <artifactId>testng</artifactId>
47 <version>${testng.version}</version>
48 <scope>test</scope>
49 </dependency>
50
51 <!-- Apache Common -->
52 <dependency>
53 <groupId>org.apache.directory.studio</groupId>
54 <artifactId>org.apache.commons.io</artifactId>
55 <version>${apache.common.version}</version>
56 </dependency>
57
58 </dependencies>
Step 7 – Add Maven Compiler Plugin and Surefire Plugin
The compiler plugin is used to compile the source code of a Maven project. This plugin has two goals,

which are already bound to specific phases of the default lifecycle:

 compile – compile main source files


 testCompile – compile test source files
1 <plugins>
2 <plugin>
3 <groupId>org.apache.maven.plugins</groupId>
4 <artifactId>maven-compiler-plugin</artifactId>
5 <version>${maven.compiler.plugin.version}</version>
6 <configuration>
7 <source>${maven.compiler.source.version}</source>
8 <target>${maven.compiler.target.version}</target>
9 </configuration>
10 </plugin>
11 <plugin>
12 <groupId>org.apache.maven.plugins</groupId>
13 <artifactId>maven-surefire-plugin</artifactId>
14 <version>${maven.surefire.plugin.version}</version>
15 <configuration>
16 <includes>
17 <include>**/*Tests.java</include>
18 </includes>
19 </configuration>
20 </plugin>
21 </plugins>
The complete POM.xml looks like as shown below

1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi=


2 "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
3 "http://maven.apache.org/POM/4.0.0https://maven.apache.org/xsd/maven-4.0.0.xsd">
4 <modelVersion>4.0.0</modelVersion>
5 <groupId>com.example</groupId>
6 <artifactId>POM_CucumberTestNGDemo</artifactId>
7 <version>0.0.1-SNAPSHOT</version>
8
9 <properties>
10 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
11 <cucumber.version>7.14.0</cucumber.version>
12 <selenium.version>4.14.0</selenium.version>
13 <webdrivermanager.version>5.5.3</webdrivermanager.version>
14 <testng.version>7.8.0</testng.version>
15 <apache.common.version>2.4</apache.common.version>
16 <maven.compiler.plugin.version>3.11.0</maven.compiler.plugin.version>
17 <maven.surefire.plugin.version>3.1.2</maven.surefire.plugin.version>
18 <maven.compiler.source.version>11</maven.compiler.source.version>
19 <maven.compiler.target.version>11</maven.compiler.target.version>
20 </properties>
21
22 <dependencies>
23
24 <dependency>
25 <groupId>io.cucumber</groupId>
26 <artifactId>cucumber-java</artifactId>
27 <version>${cucumber.version}</version>
28 </dependency>
29
30 <dependency>
31 <groupId>io.cucumber</groupId>
32 <artifactId>cucumber-testng</artifactId>
33 <version>${cucumber.version}</version>
34 <scope>test</scope>
35 </dependency>
36
37 <!-- Selenium -->
38 <dependency>
39 <groupId>org.seleniumhq.selenium</groupId>
40 <artifactId>selenium-java</artifactId>
41 <version>${selenium.version}</version>
42 </dependency>
43
44 <!-- Web Driver Manager -->
45 <dependency>
46 <groupId>io.github.bonigarcia</groupId>
47 <artifactId>webdrivermanager</artifactId>
48 <version>${webdrivermanager.version}</version>
49 </dependency>
50
51 <!-- TestNG -->
52 <dependency>
53 <groupId>org.testng</groupId>
54 <artifactId>testng</artifactId>
55 <version>${testng.version}</version>
56 <scope>test</scope>
57 </dependency>
58
59 <!-- Apache Common -->
60 <dependency>
61 <groupId>org.apache.directory.studio</groupId>
62 <artifactId>org.apache.commons.io</artifactId>
63 <version>${apache.common.version}</version>
64 </dependency>
65
66
67 </dependencies>
68
69 <build>
70 <plugins>
71 <plugin>
72 <groupId>org.apache.maven.plugins</groupId>
73 <artifactId>maven-compiler-plugin</artifactId>
74 <version>${maven.compiler.plugin.version}</version>
75 <configuration>
76 <source>${maven.compiler.source.version}</source>
77 <target>${maven.compiler.target.version}</target>
78 </configuration>
79 </plugin>
80 <plugin>
81 <groupId>org.apache.maven.plugins</groupId>
82 <artifactId>maven-surefire-plugin</artifactId>
83 <version>${maven.surefire.plugin.version}</version>
84 <configuration>
85 <suiteXmlFiles>
86 <suiteXmlFile>testng.xml</suiteXmlFile>
87 </suiteXmlFiles>
88 </configuration>
89 </plugin>
90 </plugins>
</build>
</project>
Step 8 – Create a feature file in the src/test/resources
Create a folder with name features. Now, create the feature file in this folder. The feature file should be
saved with the extension .feature. This feature file contains the test scenarios created to test the
application. The Test Scenarios are written in Gherkins language in the format of Given, When,
Then, And, But.

Below is an example of Test Scenarios in the feature file. I have failed one test scenario intentionally –
@MissingUsername.
1 Feature: Login to HRM Application
2
3 Background:
4 Given User is on HRMLogin page "https://opensource-demo.orangehrmlive.com/"
5
6 @ValidCredentials
7 Scenario: Login with valid credentials
8
9 When User enters username as "Admin" and password as "admin123"
10 Then User should be able to login successfully and new page open
11
12 @InvalidCredentials
13 Scenario Outline: Login with invalid credentials
14
15 When User enters username as "<username>" and password as "<password>"
16 Then User should be able to see error message "<errorMessage>"
17
18 Examples:
19 | username | password | errorMessage |
20 | Admin | admin12$$ | Invalid credentials |
21 | admin$$ | admin123 | Invalid credentials |
22 | abc123 | xyz$$ | Invalid credentials |
23
24
25 @MissingUsername
26 Scenario Outline: Login with blank username
27
28 When User enters username as " " and password as "admin123"
29 Then User should be able to see a message "Required1" below Username
Step 9 – Create the classes for locators, actions, and utilities in src/main/java
Create folders – actions, locators, and utils in src/main/java.
Create a Java Class for each page where define WebElements as variables using Annotation @FindBy.
Create another Java class that contains methods for actions performed on WebElements. Here, I’m going
to create 2 classes for locators – LoginPageLocators and HomePageLocators as well as 2 classes
for actions – LoginPageActions and HomePageActions
The Locator class contains WebElements which are identified by @FindBy annotation as shown below:-
1 @FindBy(name = "txtUsername")
2 WebElement userName;
Action class contains methods for the action to be performed on the web elements identified in the locator
class.
The initElements is a static method of PageFactory class that is used to initialize all the web elements
located by @FindBy annotation. Only after the WebElements are initialized, they can be used in
the methods to perform actions.
1 public Login(WebDriver driver) {
2 this.driver = driver;
3 // This initElements method will create all WebElements
4 PageFactory.initElements(driver, this);
5 }
Below is the sample code of the LoginPageLocators.
1 import org.openqa.selenium.WebElement;
2 import org.openqa.selenium.support.FindBy;
3
4 public class LoginPageLocators
{5
6 @FindBy(name = "username")
7 public WebElement userName;
8
9 @FindBy(name = "password")
10 public WebElement password;
11
12 @FindBy(xpath = "//*[@id='app']/div[1]/div/div[1]/div/div[2]/div[2]/form/div[1]/div/span")
13 public WebElement missingUsernameErrorMessage;
14
15 @FindBy(xpath = "//*[@id='app']/div[1]/div/div[1]/div/div[2]/div[2]/form/div[3]/button")
16 public WebElement login;
17
18 @FindBy(xpath = "//*[@id='app']/div[1]/div/div[1]/div/div[2]/div[2]/div/div[1]/div[1]/p")
19 public WebElement errorMessage;
20
21 }
Below is the sample code for the HomePageLocators.
1 import org.openqa.selenium.WebElement;
2 import org.openqa.selenium.support.FindBy;
3
4 public class HomePageLocators
{5
6 @FindBy(xpath = "//span[@class='oxd-topbar-header-breadcrumb']/h6")
7 public WebElement homePageUserName;
8
9 }
Create the action classes for each web page. These action classes contain all the methods needed by the
step definitions. In this case, I have created 2 action classes – LoginPageActions, HomePageActions
LoginPageActions
1 import org.example.locators.LoginPageLocators;
2 import org.example.utils.HelperClass;
3 import org.openqa.selenium.support.PageFactory;
4
5 public class LoginPageActions
{6
7 LoginPageLocators loginPageLocators = null;
8
9 public LoginPageActions()
{10
11 this.loginPageLocators = new LoginPageLocators();
12
13 PageFactory.initElements(HelperClass.getDriver(),loginPageLocators);
14 }
15
16 // Get the error message when username is blank
17 public String getMissingUsernameText() {
18 return loginPageLocators.missingUsernameErrorMessage.getText();19
}
20
21 // Get the Error Message
22 public String getErrorMessage() {
23 return loginPageLocators.errorMessage.getText();24
}
25
26 public void login(String strUserName, String strPassword)
{27
28 // Fill user name
29 loginPageLocators.userName.sendKeys(strUserName);
30
31 // Fill password
32 loginPageLocators.password.sendKeys(strPassword);
33
34 // Click Login button
35 loginPageLocators.login.click();
36
37 }
HomePageActions
1 import org.example.locators.HomePageLocators;
2 import org.example.utils.HelperClass;
3 import org.openqa.selenium.support.PageFactory;
4
5 public class HomePageActions
{6
7 HomePageLocators homePageLocators = null;
8
9 public HomePageActions()
{10
11 this.homePageLocators = new HomePageLocators();
12 PageFactory.initElements(HelperClass.getDriver(),homePageLocators); 13
}
14
15 // Get the User name from Home Page
16 public String getHomePageText() {
17 return homePageLocators.homePageUserName.getText();18
}
19
20 }
Create a Helper class where we are initializing the web driver, initializing the web driver wait,
defining the timeouts, and creating a private constructor of the class, it will declare the web driver, so
whenever we create an object of this class, a new web browser is invoked.
1 package com.example.utils;
2
3 import java.time.Duration;
4 import org.openqa.selenium.WebDriver;
5 import org.openqa.selenium.chrome.ChromeDriver;
6 import io.github.bonigarcia.wdm.WebDriverManager;
7 import org.openqa.selenium.chrome.ChromeOptions;
8
9 public class HelperClass
{10
11 private static HelperClass helperClass;
12
13 private static WebDriver driver;
14 public final static int TIMEOUT = 5;
15
16 private HelperClass()
{17
18 WebDriverManager.chromedriver().setup();
19 ChromeOptions options = new ChromeOptions();
20 options.addArguments("--start-maximized");
21 driver = new ChromeDriver(options);
22 driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(TIMEOUT));
23 }
24
25 public static void openPage(String url) {
26 driver.get(url);27
}
28
29 public static WebDriver getDriver() {
30 return driver;31
}
32
33 public static void setUpDriver()
{34
35 if (helperClass==null)
{36
37 helperClass = new HelperClass();
38 }
39 }
40
41 public static void tearDown() {
42
43 if(driver!=null)
44 {driver.close()
45 ;driver.quit();
46 }
47
48 helperClass = null;
49 }
50
51 }
Step 10 – Create a StepDefinition class in src/test/java
Create a Java Class called Definition where we will create the Test Code related to the Given, When
, Then of Feature file in src/test/java.

Now, we need to create the Step Definition of the Feature File – LoginPageDefinitions.java.
1 import io.cucumber.java.en.Given;
2 import io.cucumber.java.en.Then;
3 import io.cucumber.java.en.When;
4 import org.example.actions.HomePageActions;
5 import org.example.actions.LoginPageActions;
6 import org.example.utils.HelperClass;
7 import org.testng.Assert;
8
9 public class LoginPageDefinitions
{10
11 LoginPageActions objLogin = new LoginPageActions();
12 HomePageActions objHomePage = new HomePageActions();
13
14 @Given("User is on HRMLogin page {string}")
15 public void loginTest(String url)
{16
17 HelperClass.openPage(url);
18
19 }
20
21 @When("User enters username as {string} and password as {string}")
22 public void goToHomePage(String userName, String passWord)
{23
24 // login to application
25 objLogin.login(userName, passWord);
26
27 // go the next page
28
29 }
30
31 @Then("User should be able to login successfully and new page open")
32 public void verifyLogin()
{33
34 // Verify home page
35 Assert.assertTrue(objHomePage.getHomePageText().contains("Dashboard"));
36
37 }
38
39 @Then("User should be able to see error message {string}")
40 public void verifyErrorMessage(String expectedErrorMessage)
{41
42 // Verify error message
43 Assert.assertEquals(objLogin.getErrorMessage(),expectedErrorMessage);
44
45 }
46
47 @Then("User should be able to see a message {string} below Username")
48 public void verifyMissingUsernameMessage(String message) {
49
50 Assert.assertEquals(objLogin.getMissingUsernameText(),message);
51 }
52
53 }
Step 11 – Create a Hook class in src/test/java
Create the hook class that contains the Before and After hook to initialize the web browser and
close the web browser. I have added the code to take the screenshot of the failed scenario in
@After Hook.

Below is the code for the Hooks class.


1 import org.openqa.selenium.OutputType;
2 import org.openqa.selenium.TakesScreenshot;
3 import com.example.utils.HelperClass;
4 import io.cucumber.java.After;
5 import io.cucumber.java.Before;
6 import io.cucumber.java.Scenario;
7
8 public class Hooks
{9
10 @Before
11 public static void setUp()
{12
13 HelperClass.setUpDriver();
14 }
15
16 @After
17 public static void tearDown(Scenario scenario)
{18
19 //validate if scenario has failed
20 if(scenario.isFailed()) {
21 final byte[] screenshot = ((TakesScreenshot) HelperClass.getDriver())
22 .getScreenshotAs(OutputType.BYTES);
23 scenario.attach(screenshot, "image/png", scenario.getName());24
}
25
26 HelperClass.tearDown();
27 }
}
Step 12 – Create a TestNG Cucumber Runner class in the src/test/java
Cucumber needs a TestRunner class to run the feature files. It is suggested to create a folder with
the name of the runner in the src/test/java directory and create the Cucumber TestRunner class in
this folder. Below is the code of the Cucumber TestRunner class.
Below is the code for CucumberRunnerTests class.
import io.cucumber.testng.AbstractTestNGCucumberTests;
12 import io.cucumber.testng.CucumberOptions;
3
@CucumberOptions(tags = "", features = "src/test/resources/features/LoginPage.feature"
4 , glue = "org.example.definitions",
5
plugin = {})
6
7
public class CucumberRunnerTests extends AbstractTestNGCucumberTests {
8 }
Note:- The name of the Runner class should end with Test otherwise we can’t run the tests using
Command Line.
Step 13 – Run the tests from TestNG
You can execute the test script by right-clicking on TestRunner class -> Run As TestNG. (Eclipse)
In the case of the IntelliJ project, right-click on the runner class and select Run ‘CucumberRunnerTests’.

The output of the above program is

Step 14 – Run the tests from testng.xml


Create a TestNG.xml as shown below and run the tests as TestNG.
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
3 <suite name="Suite">
4 <test name="Cucumber with TestNG Test">
5 <classes>
6 <class name="org.example.runner.CucumberRunnerTests"/>
7 </classes>
8 </test><!-- Test -->
9 </suite><!-- Suite -->
The testng.xml is highlighted below:

Step 15 – Run the tests from Command Line


Run the below command in the command prompt to run the tests and to get the test execution report.

1 mvn clean test


The output of the above program is

Step 16 – Cucumber Report Generation


To get Cucumber Test Reports, add cucumber.properties under src/test/resources and add the below
instruction in the file.
1 cucumber.publish.enabled=true
Below is the image of the Cucumber Report generated using the Cucumber Service.

In the above example, as we can see, one of the tests has failed. So, when a test fails, we have written
the code to take a screenshot of the failed step. The Attached Image shows the image of the failed
test. You can click on that to see the screenshot.
Step 17 – TestNG Report Generation
TestNG generates various types of reports under the target->surefire-reports folder like emailable-
report.html, index.html, testng-results.xml.
We are interested in the “emailable-report.html” report. Open “emailable-report.html“, as this is an HTML
report, and open it with the browser. The below image shows emailable-report.html.
emailable-report.html
Index.html
TestNG also produces an “index.html” report. The below image shows the index.html report.

RESULT:

You might also like