KEMBAR78
Software Testing Lab Record 2024 | PDF | Engineering | Software Testing
0% found this document useful (0 votes)
38 views65 pages

Software Testing Lab Record 2024

The document outlines the lab record work for the Software Testing and Automation course (CCS366) at Saranathan College of Engineering for the academic year 2024-2025. It includes a detailed table of contents for various experiments, the vision and mission of the Computer Science and Engineering department, program educational objectives, and course outcomes. Additionally, it provides a rubric for assessment and a sample test plan for testing an e-commerce application.

Uploaded by

bhuvii692003
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)
38 views65 pages

Software Testing Lab Record 2024

The document outlines the lab record work for the Software Testing and Automation course (CCS366) at Saranathan College of Engineering for the academic year 2024-2025. It includes a detailed table of contents for various experiments, the vision and mission of the Computer Science and Engineering department, program educational objectives, and course outcomes. Additionally, it provides a rubric for assessment and a sample test plan for testing an e-commerce application.

Uploaded by

bhuvii692003
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/ 65

SARANATHAN COLLEGE OF ENGINEERING

AN AUTONOMOUS INSTITUTION
PANJAPPUR, TIRUCHIRAPPALLI–620012

CCS366

SOFTWARE TESTING AND AUTOMATION


(Regulation 2021)

LAB RECORD WORK

Academic Year 2024-2025


ODD SEMESTER

NAME:

BATCH NUMBER:

YEAR / SEMESTER / SECTION:

REGISTER NUMBER:

BRANCH:
TABLE OF CONTENTS

Ex. No. Date Experiment Name Page No. Signature

Develop the test plan for testing an e-


1.
commerce web/mobile application

Design the test cases for testing the e-


2.
commerce application

3.
Test the e-commerce application and report
the defects in it
Develop the test plan and design the test
4. cases for an inventory control system.

5.
Execute the test cases against a client server
or desktop application and identify the
defects
Test the performance of the e-commerce
6.
application.
Automate the testing of e-commerce
7.
applications using Selenium.

Integrate TestNG with the above test


8. automation
a) Build a data-driven framework using
9.
Selenium and TestNG
b) Build Page object Model using Selenium
10.
and TestNG
c) Build BDD framework with Selenium,
11.
TestNG and Cucumber

Staff In-charge Signature


SARANATHAN COLLEGE OF ENGINEERING
An Autonomous Institution
Venkateswara Nagar, Panjappur
Tiruchirappalli – 620 012.
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Vision of the Department:

To evolve as a Centre of academic excellence and advanced research in Computer


Science and Engineering discipline.

Mission of the Department:

1. To inculcate in students a profound understanding of fundamentals related to discipline.


2. To inculcate skills, attitudes and their applications in solving real world problems
with an inclination towards societal issues and research.

3. To promote research in the emerging areas of computer science and technology.

Program Educational Objectives (PEOs):

The Graduates after three to five years of their graduation will

PEO1: Acquire strong foundation in the mathematical, scientific and


engineering fundamentals necessary to formulate, solve and analyze
engineering problems.

PEO2: Develop the ability to analyze the requirements of the software,


understand the technical specifications, design and provide novel
engineering solutions and efficient software/hardware designs.

PEO3: Have exposure to emerging cutting- e d g e technologies, adequate


training& opportunities to work as teams on multidisciplinary projects with
effective communication skills and leadership qualities.

PEO4: Have awareness on the life-long learning and prepare them for
research development and consultancy.

PEO5: Have a successful career and work with values & social concern
bridging the digital divide and meet the requirements of Indian and
multinational companies.
Program Specific Outcome (PSO):

PSO1: Foundation of mathematical concepts: To use mathematical methodologies to


crack problem using suitable mathematical analysis, data structure and suitable
algorithm.
PSO2: Foundation of Computer System: the ability to interpret the fundamental
concepts and methodology of computer systems. Students can understand the
functionality of hardware and software aspects of computer systems.
PSO3: Foundations of Software development: the ability to grasp the software
development lifecycle and methodologies of software systems. Possess
competent skills and knowledge of software design process. Familiarity and
practical proficiency with a broad area of programming concepts and provide
new ideas and innovations towards research.

Program outcomes (POs):

S.No. Program Outcomes


PO1: Engineering knowledge:
1. To Apply the knowledge of mathematics, science, engineering fundamentals, and an
engineering specialization to the solution of complex engineering problems.
PO2: Problem analysis:
Identify, formulate, review research literature, and analyze complex engineering
2.
problems reaching substantiated conclusions using first principles of mathematics,
natural sciences, and engineering sciences.
PO3: Design/development of solutions:
Design solutions for complex engineering problems and design system components
3. or processes that meet the specified needs with appropriate considerations for the
public health and safety, and the cultural, societal, and environmental
considerations.
PO4: Conduct investigations of complex problems:
Use research-based knowledge and research methods including design of
4.
experiments, analysis and interpretation of data, and synthesis of the information to
provide valid conclusions.
PO5: Modern tool usage:
Create, select, and apply appropriate techniques, resources, and modern
5.
engineering and IT tools including prediction and modeling to complex
engineering activities with an understanding of the limitations
PO6: The engineer and society:
Apply reasoning informed by the contextual knowledge to assess societal, health,
6.
safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
PO7: Environment and sustainability:
Understand the impact of the professional engineering solutions in societal and
7.
environmental contexts, and demonstrate the knowledge of, and need for sustainable
development.
PO8: Ethics:
8. Apply ethical principles and commit to professional ethics and responsibilities
and norms of the engineering practice.
PO9: Individual and Team Work:
9. Use Function effectively as an individual and as a member or leader to diverse
teams, and in multidisciplinary settings.
PO10: Communication:
Communicate effectively on complex engineering activities with the engineering

10. community and with society at large, such as, being able to comprehend and write
effective report and design documentation, make effective presentations, and give
and receive clear instructions.
PO11: Project management and finance:
Demonstrate knowledge and understanding of the engineering and management
11.
principles and apply these to one’s own work, as a member and leader in a team,
to manage projects and in multidisciplinary environments.
PO12: Life-long learning:
Recognize the need for, and have the preparation and ability to engage in
12.
independent and life- long learning in the broadest context of technological
change.
SARANATHAN COLLEGE OF ENGINEERING
(An Autonomous Institution)
Panjappur, Tiruchirapalli-620 012

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


ACADEMIC YEAR 2024-2025

SUBJECT CODE & TITLE CCS366 – SOFTWARE TESTING


AND AUTOMATION
YEAR / SEM / SEC IV / VII / A

NAME OF THE STUDENT

REG.NO

NAME OF THE EVALUATOR

MARKS OUT OF 20

RUBRIC ASSESSMENT FOR LAB COURSES


Performance Level 1 Level 2 Level 3
Indicators (0-1) (2-4) (5)
Explanation to, the Pre Explanation to, the Pre Explanation to, the Pre
lab questions and lab questions and lab questions and
Pre lab
objectives of the objectives of the objectives of the
questions,
experiment, is, where experiment, is, where experiment, is, where
objectives
compared to the compared to the compared to the
(P-I) expectation of the faculty expectation of the faculty expectation of the faculty
is not satisfactory. is partially satisfactory. is highly satisfactory.

Explanation to the Explanation to the Explanation to the


procedure of the procedure of the procedure of the
Procedures experiment, is, where experiment, is, where experiment, is, where
(P-II) compared to the compared to the compared to the
expectation of the faculty expectation of the faculty expectation of the faculty
is not satisfactory. is partially satisfactory. is highly satisfactory.

Calculation of the Calculation of the Calculation of the


Data/
observed values and observed values and observed values and
Observations validation of the results validation of the results validation of the results
(P-III) of the experiment of the experiment of the experiment
inaccurate. approximate precise.

Explanation to the Post Explanation to the Post Explanation to the Post


lab questions and lab questions and lab questions and
Post lab Conclusions of the Conclusions of the Conclusions of the
questions, experiment, is, where experiment is, where experiment, is, where
Conclusions compared to the compared to the compared to the
expectation of the faculty expectation of the faculty expectation of the faculty
(P-IV)
is not satisfactory. partially satisfactory. is highly satisfactory.
Register No:

Assessment Sheet

P -I P-II P-III P-IV TOTAL


S.no Date Name of the Exercise
[5] [5] [5] [5] [20]

Develop the test plan for testing an e-


1 commerce web/mobile application

Design the test cases for testing the e-


2
commerce application

Test the e-commerce application and


3
report the defects in it.

Develop the test plan and design the


4 test cases for an inventory control
system.
Execute the test cases against a client
5
server or desktop application and
identify the defects.

Test the performance of the e-


6
commerce application

Automate the testing of e-commerce


7 applications using Selenium

Integrate TestNG with the above test


8. automation

a) Build a data-driven framework


9. using Selenium and TestNG

b) Build Page object Model using


10. Selenium and TestNG

c) Build BDD framework with


11. Selenium, TestNG and Cucumber

SIGNATURE OF EVALUATOR
Subject Title: SOFTWARE TESTING AND AUTOMATION
Subject Code: CCS366 COURSE

OUTCOMES

At the end of this course, the students will be able to:

CO-Code Course outcome Description

CO1 Develop the test plan for testing an e-commerce web/mobile application

CO2 Design the test cases for testing the e-commerce application.

CO3 Test the e-commerce application and report the defects in it.

CO4 Develop the test plan and design the test cases for an inventory control system.

CO5 Execute the test cases against a client server or desktop application and identify the defects.

CO6 Test the performance of the e-commerce application.

CO7 Automate the testing of e-commerce applications using Selenium

CO8 Integrate TestNG with the above test automation.

CO9 a) Build a data-driven framework using Selenium and TestNG

CO10 b) Build Page object Model using Selenium and TestNG

CO11 c) Build BDD framework with Selenium, TestNG and Cucumber


CO’s-PO’s & PSO’s MAPPING
PO’s PSO’s

CO’s 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3
1 3 3 2 1 2 - - - 1 1 3 2 3 2 3
2 2 3 1 1 1 - - - 2 2 1 2 1 2 3
3 2 2 1 3 1 - - - 2 3 1 2 1 3 3
4 2 1 3 2 1 - - - 1 1 1 2 3 1 2
5 2 2 1 3 1 - - - 1 3 2 1 2 1 3

1 - low, 2 - medium, 3 - high, ‘-' - no correlation


CCS366 SOFTWARE TESTING AND AUTOMATION LABORATORY

Experiment 1: Develop the Test Plan for Testing an E-commerce Web/Mobile


Application (www.amazon.in)

Aim:
The aim of this experiment is to develop a comprehensive test plan for testing the
functionality and usability of the e-commerce web/mobile application www.amazon.in.

Algorithm:
1. Identify the Scope: Determine the scope of testing, including the features and
functionalities that need to be tested.

2. Define Test Objectives: Specify the primary objectives of testing, such as functional
testing, usability testing, performance testing, security testing, etc.

3. Identify Test Environment: Define the platforms, browsers, devices, and operating
systems on which the application will be tested.

4. Determine Test Deliverables: Decide on the documents and artifacts that will be
generated during the testing process, such as test cases, test reports, and defect logs.

5. Create Test Strategy: Develop an overall approach for testing, including the testing
techniques, entry and exit criteria, and the roles and responsibilities of the testing team.

6. Define Test Scope and Schedule: Specify the timeline for each testing phase and the
scope of testing for each phase.

7. Risk Analysis: Identify potential risks and their impact on the testing process, and devise
risk mitigation strategies.

8. Resource Planning: Allocate the necessary resources, including the testing team, hardware,
and software required for testing.

1
9. Test Case Design: Prepare detailed test cases based on the requirements and
functionalities of the e-commerce application.

10. Test Data Setup: Arrange test data required for executing the test cases effectively.

11. Test Execution: Execute the test cases and record the test results.

12. Defect Reporting: Document any defects encountered during testing and track
their resolution.

Test Plan:
The test plan should cover the following sections:
1. Introduction: Briefly describe the purpose of the test plan and provide an overview of
the e- commerce application to be tested.

2. Test Objectives: List the primary objectives of testing the application.

3. Test Scope: Specify the features and functionalities to be tested and any limitations on testing.

4. Test Environment: Describe the hardware, software, browsers, and devices to be


used for testing.

5. Test Strategy: Explain the overall approach to be followed during testing.

6. Test Schedule: Provide a detailed timeline for each testing phase.

7. Risk Analysis: Identify potential risks and the strategies to mitigate them.

8. Resource Planning: Specify the resources required for testing.

9. Test Case Design: Include a summary of the test cases developed for the application.

10. Test Data Setup: Describe the process of arranging test data for testing.

2
11. Defect Reporting: Explain the procedure for reporting and tracking defects.

Test Case Table:

Expecte Actual
Proces No. Test Case Steps Description Status d Result Commen
s Result t

1. Review Verify the The test


Test Scope the test scope of plan
Plan TC001 of plan testing. Done includes all
Testing document. features.
The test
1. Review Verify the objective
Test the test test s are
TC002 Objective plan objectives Done well-
s document. . defined.
Test
1. Review Check the environment
Test the test specified s are
TC003 Environmen plan environments Done mentioned.
t document. .

1. Review Ensure all The test


Test the test deliverable plan
TC004 Deliverable plan s are listed. Done includes all
s document. deliverables
.
The test
1. Review Verify strategy
Test the test the is clearly
TC005 Strateg plan overall Done stated.
y document. approach.

Test 1. Review Check the The schedule


Scope and the test schedule andscope are
TC006 Schedule plan and scope. Done defined.
document.

3
Risks and
Risk 1. Review Ensure mitigation
TC007 Analysi the test potential Done strategies
s plan risks are are
document. identified. mentioned.
Resources
1. Review Check needed
Resourc the test the for testing
TC008 e plan required Done are listed.
Planning document. resources
.
1. Review Test cases
and Validate the are
Test execute the prepared accurate
TC009 Case test cases. test cases. Done and
Design functional.
1. Review
the test Verify the Test data is
Test data setup availability available
TC010 Data process. of test data. Done for testing.
Setup
1. Run
the test
cases and Test results
document are recorded
TC011 Test the Execute In and
Executio outcomes. the test Progres documented
n cases. s .

1. Log Ensure Defects are


Defect defects with defects Not reported
TC012 Reportin detailed are Started with
g information reported sufficient
. correctly. details.

1. Monitor
defect Verify the Defects are
Defect status and tracking Not tracked
TC013 Trackin updates. of defects. Started until
g resolution.

4
Program:

import time

from selenium import webdriver

from webdriver_manager.chrome import ChromeDriverManager class

DemoFindElementByID():

def demo_find_element_by_id(self): driver =

webdriver.Chrome()

driver.get("https://www.amazon.in/")

driver.find_element(by = "id",

value="twotabsearchtextbox").send_keys("cricket")

driver.get("https://www.amazon.in/ap/signin.htm")

driver.find_element(by = "id",

value="ap_email").send_keys("xyz123") driver.find_element(by="id",

value="continue").click() time.sleep(4)

findbyid = DemoFindElementByID()

findbyid.demo_find_element_by_id()

5
import time

from selenium import webdriver

from webdriver_manager.chrome import ChromeDriverManager class

DemoFindElementByID():

def demo_find_element_by_id(self):

driver = webdriver.Chrome()

driver.get("https://secure.yatra.com/social/common/yatra/signin.

htm")

driver.find_element(by = "id", value="login-

input").send_keys("test@test.com")

driver.find_element(by = "id", value="login-continue-

btn").click()

driver.find_element(by = "id", value="login-

password").send_keys("test")

time.sleep(4)

findbyid = DemoFindElementByID()

findbyid.demo_find_element_by_id()

6
Explanation:
The test plan is a crucial document that outlines the entire testing process. It ensures that all
aspects of the e-commerce application are thoroughly tested, and the results are
systematically documented.

Result:
Upon completion of the experiment, you will have a well-structured test plan that provides a
clear roadmap for testing the e-commerce web/mobile application www.amazon.in.

7
Experiment 2: Design the Test Cases for Testing the E-commerce Application

Aim:
The aim of this experiment is to design a set of comprehensive and effective test cases for
testing the e-commerce application www.amazon.in.

Algorithm:
1. Understand Requirements: Familiarize yourself with the functional and non-
functional requirements of the e-commerce application.

2. Identify Test Scenarios: Based on the requirements, identify different test scenarios that
cover all aspects of the application.

3. Write Test Cases: Develop test cases for each identified scenario, including
preconditions, steps to be executed, and expected outcomes.

4. Cover Edge Cases: Ensure that the test cases cover edge cases and boundary
conditions to verify the robustness of the application.

5. Prioritize Test Cases: Prioritize the test cases based on their criticality and relevance
to the application.

6. Review Test Cases: Conduct a peer review of the test cases to ensure their accuracy
and completeness.

7. Optimize Test Cases: Optimize the test cases for reusability and maintainability.

Test Case Design:


The test case design should include the following components for each test case:

1. Test Case ID: A unique identifier for each test case.

2. Test Scenario: Description of the scenario being tested.

8
3. Test Case Description: Detailed steps to execute the test.

4. Precondition: The necessary conditions that must be satisfied before executing the test case.

5. Test Steps: The sequence of actions to be performed during the test.

6. Expected Result: The outcome that is expected from the test.

Test Case Table:

Expected Actual
Process No. Test Case Steps Description Status Result Result Comment

1.
Test Navigate Verify User can
Case User to the user successfull
Design TC001 Registratio registration registratio Done y register.
n page. n process.
1. Verify User can
Navigate user login successfull
TC002 User Login to the process. Done y log in.
login page.
Search
1. Enter a results
keyword Verify relevant
Search in the search to the
TC003 Functionalit search bar. functionality Done keyword.
y .
Verify Product is
1. Browse adding added to
the products the
TC004 Add to Cart product to the cart. Done shopping
catalog. cart.
1. Click Items in
Shopping on the Verify the the
Cart shopping shopping shopping
TC005 Validatio cart icon. cart Done cart are
n contents. displayed.
1. Click on Checkout

9
Checkou the Verify process
t Process "Checkout the Not proceeds
TC006 " button. checkout Starte as
process. d expected.

Program:

import time

from selenium import webdriver

from webdriver_manager.chrome import ChromeDriverManager class

DemoFindElementByID():

def demo_find_element_by_id(self):

driver = webdriver.Chrome()

driver.get("https://secure.yatra.com/social/common/yatra/signin.

htm")

driver.find_element(by = "id", value="login-

input").send_keys("test@test.com")

driver.find_element(by = "id", value="login-continue-

btn").click()

driver.find_element(by = "id", value="login-

password").send_keys("test")

time.sleep(4)

findbyid = DemoFindElementByID()

findbyid.demo_find_element_by_id()

10
11
12
Explanation:
Test cases are designed to validate the functionality and behaviour of the e-commerce
application. They ensure that the application performs as intended and meets the specified
requirements.

Result:
Upon completion of the experiment, you will have a set of well-defined test cases
ready for testing the e-commerce application www.amazon.in.

13
Experiment 3: Test the E-commerce Application and Report the Defects in It

Aim:
The aim of this experiment is to execute the designed test cases and identify defects or
issues in the e-commerce application www.amazon.in.

Algorithm:
1. Test Environment Setup: Set up the testing environment with the required hardware,
software, and test data.

2. Test Case Execution: Execute the test cases designed in Experiment 2, following the
specified steps.

3. Defect Identification: During test execution, record any discrepancies or issues encountered.

4. Defect Reporting: Log the identified defects with detailed information, including
steps to reproduce, severity, and priority.

5. Defect Tracking: Track the progress of defect resolution and verify fixes as they
are implemented.

6. Retesting: After defect fixes, retest the affected areas to ensure the issues are resolved.

7. Regression Testing: Conduct regression testing to ensure new changes do not introduce
new defects.

14
Test Case Table:

Expected Actual
Process No. Test Case Steps Description Status Result Result Comment

1.
Test Navigate Verify User can
Case User to the user successfull
Design TC001 Registratio registration registratio Done y register.
n page. n process.
1. Verify User can
Navigate user login successfull
TC002 User Login to the process. Done y log in.
login page.
Search
1. Enter a results
keyword Verify relevant
Search in the search to the
TC003 Functionalit search bar. functionality Done keyword.
y .
Verify Product is
1. Browse adding added to
the products the
TC004 Add to Cart product to the cart. Done shopping
catalog. cart.
1. Click Items in
Shopping on the Verify the the
Cart shopping shopping shopping
TC005 Validatio cart icon. cart Done cart are
n contents. displayed.
1. Click on Checkout
the Verify process
Checkou "Checkout the Not proceeds
TC006 t Process " button. checkout Started as
process. expected.

15
Program:

import time

from selenium import webdriver

from webdriver_manager.chrome import ChromeDriverManager class

DemoFindElementByID():

def demo_find_element_by_id(self):

driver = webdriver.Chrome()

driver.get("https://www.bigbasket.com/") driver.find_element(by

= "id",

value="input").send_keys("vegetables") driver.find_element(by =

"id", value="fresh

promogranite").click()

driver.find_element(by = "id", value="fresh banana").click()

driver.find_element(by = "id", value="fresh cocunt").click()

driver.find_element(by = "id", value="fresh Tomato").click()

driver.find_element(by = "id", value="ebufx ").click()

time.sleep(4)

findbyid = DemoFindElementByID()

findbyid.demo_find_element_by_id()

16
17
Explanation:
Testing the e-commerce application aims to validate its functionality and usability. By
identifying and reporting defects, you ensure the application's quality and reliability.

Result:
Upon completion of the experiment, you will have a list of identified defects and their status
after resolution.

18
Experiment 4: Develop the Test Plan and Design the Test Cases for an Inventory
Control System

Aim:
The aim of this experiment is to create a comprehensive test plan and design test cases for
an Inventory Control System.

Algorithm:
Follow the same algorithm as described in Experiment 1 for developing the test plan
for an inventory control system.

Follow the same algorithm as described in Experiment 2 for designing test cases for an
inventory control system.

Test Plan:

Expecte Actual
Proces No. Test Case Steps Description Status d Result Commen
s Result t

The test
1. Review the plan
requirements Verify the includes
Test Scope and project scope of all
Plan TC001 of documentation testing. Done essential
Testing . features.
2. Identify
the modules
to be tested.

3.
Determine
the out-of-
scope items.

19
Expecte Actual
Proces No. Test Case Steps Description Status d Result Commen
s Result t

1. Review the The test


requirements Verify the objectives
Test and project test are
TC002 Objective documentation objectives Done clearly
s . . defined.
2. Discuss
with
stakeholders
to understand
expectations.
1. Identify
the hardware Verify the The test
Test and software required Not environmen
TC003 Environmen requirements environments Starte t is defined.
t . . d
2. Set up the
required
hardware
and
software.
1. Determine All
the Verify the necessary
Test documents required Not document
TC004 Deliverable and artifacts deliverables Starte s are
s to be . d listed.
produced.
2. Create
templates
for test
reports,
defect logs,
etc.
1. Decide on Verify the
the testing overall The test
Test approach approach Not strategy
TC005 Strateg and for testing. Starte is
y techniques. d defined.

20
Expecte Actual
Proces No. Test Case Steps Description Status d Result Commen
s Result t

2.
Determine
the entry
and exit
criteria.
1. Define
Test the timeline Verify the The
Scope and for each schedule Not schedule is
TC006 Schedule testing for testing. Starte established
phase. d .
2. Determine
the scope of
testing for
each phase.

Potential
risks are
1. Identify Verify risk identified
potential analysis with
Risk risks in the and Not mitigatio
TC007 Analysi Starte n plans.
testing mitigation
s process. strategies. d

2. Discuss
risk
mitigation
strategies
with the team.
1. Allocate Resources
the required Verify the needed
Resourc resources for availability Not for testing
TC008 e testing. of resources. Starte are
Planning d allocated.
2. Determine
the roles and
responsibilitie
s of the team.

21
Test Case Design:

Expecte Actual
Proces No. Test Case Steps Description Status d Result Commen
s Result t

1. Review Verify the All


Test Module A - the functionalit functionalitie
Case Functionalit requirements y of Module Not s of Module
Desig TC001 y Test related to A. Starte A are tested.
n Module A. d
2. Identify
test scenarios
for Module
A.
3. Develop
detailed
test cases
for Module
A.
1. Review Verify the
Module B the integration Module B
- requirements of Module Not is
TC002 Integration related to B with Starte successfull
Test Module B. others. d y
integrated.
2. Identify
integration
points with
other
modules.
3. Design
test cases for
testing
integration
scenarios.

22
Expecte Actual
Proces No. Test Case Steps Description Status d Result Commen
s Result t

1. Review Verify the Module C


Module C - the performanc performs
Performanc performance e of Module Not optimally
TC003 e Test requirements C. Starte under
for Module d load.
C.
2.
Determine
performanc
e metrics to
be
measured.
3. Develop
performanc
e test cases
for Module
C.
1. Review the
Module D usability Verify the Module D is
- Usability requirements usability Not user-
TC004 Test for Module of Module Starte friendly and
D. D. d intuitive.
2. Identify
usability
aspects to
be tested.

3. Create
test cases
for
evaluating
Module D's
usability.
Module E
1. Review is protected
the security Verify the against
Module E - requirements security Not security
TC005 Security for Module of Module Starte threats.
Test E. E. d

2.
Identify
potential

23
Expecte Actual
Proces No. Test Case Steps Description Status d Result Comment
s Result
security
vulnerabilities
.

3. Design
security test
cases to
assess
Module E.

Program:

'''

Restaurant billing system '''

import time

name_list={} #names and usernames of all registered peoples

login_data={} #list of all username with passwords item_list={}

#food items with its price

item_serial={} #food items with serial no.. like 1,2,3....

bill={} #contains dish_name:quantity for order

no_of_dish=1 #it is used to print 1,2,3... serial no. in front of items

def register(call): #call takes value 1 if it is called by admin() else takes 2 if called by customer()

print(" Register ")

name=input("Enter Name :")

username=input("Enter Username :")

password=input("Enter Password :") for i in

24
login_data.keys():

if i==username:

print("\nUser Already Exits! Please Login") if

call==1:

return login(1) #by default returns true because forcefully everyone is registered

else:

return login(2)

#if user exist then login is called and by default true value is returned

else:

login_data[username]=password name_list[username]=name

print("\nHeyy",name,"You Are Registered successfully...\nLogin to Continue") if

call==1:

return login(1) #by default returns true because forcefully everyone is registered else:

return login(2)

def login(call):

print(" Login ")

un=input("Enter Username :")

pd=input("Enter Password :")

userexist=False #by default user doesn't exist before checking condition for i

in login_data.keys():

if i==un:

userexist=True #if user exist then it would be true if

login_data[un]==pd:

print("\nLogin Successful")

print("Welcome ",name_list[un]," Explore things easily here!\n")

return True

25
else:

print("\nIncorrect Username/Password .Please Try again")


if call==1:

return login(1) #by default returns true because forcefully everyone is registered else:

return login(2)

if userexist==False: #this will be only execute when user with specified username doesn't exist

print("\nUser not found... Please register or login with different account to continue")

if call==1:

return admin() #by default returns true because forcefully everyone is registered else:

return customer()

def admin(): print("1.Login")

print("2.Register")

ch=int(input("Enter your choice :")) if

ch==1:

val=login(1)#val is return value of login() function #1 is for admin() login call

else:

val=register(1) #by default returns true because forcefully everyone is registered

while val==True:

print(" ")

print("1.Modify Menu")

print("2.Display Menu")

print("3.Logout")

choice=int(input("Enter your choice :")) if

choice==1:

print("1.Add item")

print("2.Delete item")
26
print("3.Go Back")

kh=int(input("Enter your choice :")) if

kh==1:

add_item() elif

kh==2:

delete_item() else:

continue elif

choice==2:

display_menu() else:

val=False #session time out.Termination of while loop

print("Logout Successfully")

main() #after logout customer can login so main() is called here

def customer(): print("1.Login")

print("2.Register")

ch=int(input("Enter your choice :")) if

ch==1:

val=login(2)#val is return value of login() function #2 is for customer() login call


else:

val=register(2) #by default returns true because forcefully everyone is registered

while val==True:

print(" ")

print("1.Display Menu")

print("2.Order food")

print("3.Logout")

choice=int(input("Enter your choice :")) if

choice==1:
27
display_menu() elif

choice==2:

val=order_food() else:

val=False #session time out.Termination of while loop

print("Logout Successfully")

main() #after logout another can login so main() is called here

def add_item():

print(" Add Item ")

name=input("Enter Name of Dish :") price=int(input("Enter

Price :"))

item_list[name]=price

global no_of_dish #by default in python we have to say compiler that this is global variable

item_serial[no_of_dish]=name # serial number(key):dish_name(value)

no_of_dish+=1

print("\nItem Added Successfully")

def delete_item():

print(" Delete Item ") if

len(item_list)==0:

print("Nothing left to delete") else:

name=input("Enter Name of Dish :") for i

in range(len(item_list)):

if name in item_list.keys():

del(item_list[name])

print("\nItem deleted Successfully") else:

print("\nIncorrect Details... try again") break

28
def display_menu():

print(" FOOD MENU ")

if(len(item_list))==0:

print("Nothing to Show for now") else:

number=1 #it is used to print 1,2,3... serial no. in front of items for i

in item_list.keys():

print(number,".",i,"\t= ",item_list[i])

number+=1

def order_food():

display_menu()

print("----------------Order Food from above Menu ------ ")

if(len(item_list))==0:

print("Oops. Nothing to order for now!")

order=False else:

order=True while

order==True:

dish_number=int(input("Enter dish number :-"))

quantity=int(input("Enter Quantity :-"))

bill[item_serial[dish_number]]=quantity

#here item_serial[dish_number]==dish_name and bill contains dish_name(key):quantity(value)

cont=input("Want to add more ?(y/n): ") #for repeatation of loop

if cont=='Y' or cont=='y':

order=True else:

order=False

print("\nFood Ordered successfuly\n\n")

return generate_bill() #value returned by gererate_bill() function will be again returned to customer()
where order_food() is called

29
def animate_bill(): for i

in range(4):

print("\rGenerating your BILL ",end="");


time.sleep(0.5)

print("\rGenerating your BILL. ",end="");

time.sleep(0.5)

print("\rGenerating your BILL.. ",end="");

time.sleep(0.5)

print("\rGenerating your BILL... ",end="");

time.sleep(0.5)

print("\rGenerating your BILL ",end="");

time.sleep(0.5)

print("\n\tBill Generated Successfully")

def generate_bill():

animate_bill()

print("\n Bill ")

number=1

t_bill=0

for i in bill.keys():

one_tbill=bill[i]*item_list[i] # total amount of one item

print(number,".",i,"\t",bill[i],"x",item_list[i]," = ",one_tbill)#serial number. dish_name


quantity*price = total_price

t_bill+=one_tbill number+=1

print(" ")

print(" TOTAL BILL = ",t_bill)

print(" Gst 5% = "+"{:.2f}".format((t_bill/100)*5)) #to print upto 2 decimal places


30
print(" Cgst 5% = "+"{:.2f}".format((t_bill/100)*5))

t_bill+=t_bill/10

print(" ")

print("Grand Total = ",t_bill)

print(" ")

thank_msg()

return True ## this will be excepted by order_food() function

def thank_msg(): print("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\

THANK YOU \n\

Visit Again ! \

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^")

def main():

print(" Welcome ")

print("1.Admin panel")

print("2.Customer panel")

print("3.Exit")

choice=int(input("Enter your choice :")) if

choice==1:

admin()

elif choice==2:

customer() else:

31
return 0

main() #main function call ++starting of

"C:\Program Files\Python311\python.exe"
C:\Users\VSB\PycharmProjects\pythonProject1\LearningSelenium\firefoxbrowser.py

Welcome

1. Admin panel

2. Customer panel 3.Exit

Enter your choice :1 1.Login

2.Register

Enter your choice :1

Login

Enter Username :name Enter

Password :password

User not found... Please register or login with different account to continue

1.Login

2.Register

Enter your choice :l

Traceback (most recent call last):

File "C:\Users\VSB\PycharmProjects\pythonProject1\LearningSelenium\firefoxbrowser.py", line 242, in


<module>

main() # main function cal

^^^^^^

File "C:\Users\VSB\PycharmProjects\pythonProject1\LearningSelenium\firefoxbrowser.py", line 235, in


main

admin()

32
File "C:\Users\VSB\PycharmProjects\pythonProject1\LearningSelenium\firefoxbrowser.py", line 70, in
admin

val = login(1) # val is return value of login() function #1 is for admin() login call

^^^^^^^^

File "C:\Users\VSB\PycharmProjects\pythonProject1\LearningSelenium\firefoxbrowser.py", line 60, in


login

return admin() # by default returns true because forcefully everyone is registered

^^^^^^^

File "C:\Users\VSB\PycharmProjects\pythonProject1\LearningSelenium\firefoxbrowser.py", line 68, in


admin

ch = int(input("Enter your choice :"))

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError:

invalid literal for int() with base 10: 'l'

Process finished with exit code 1

"C:\Program Files\Python311\python.exe"
C:\Users\VSB\PycharmProjects\pythonProject1\LearningSelenium\firefoxbrowser.py

Welcome

1. Admin panel

2. Customer panel 3.Exit

Enter your choice :2 1.Login

2.Register

Enter your choice :2

Register
Enter Name :sen Enter

Username :sent Enter

Password :sent

Heyy sen You Are Registered successfully...


33
Login to Continue

Login

Enter Username :sent Enter

Password :sent

Login Successful

Welcome sen Explore things easily here!

1. Display Menu

2. Order food 3.Logout

Enter your choice :2

FOOD MENU

Nothing to Show for now

----------------Order Food from above Menu--------------

Oops...Nothing to order for now!

Food Ordered successfuly

Generating your BILL....

Bill Generated Successfully

Bill

TOTAL BILL =

0 Gst 5% =

0.00

Cgst 5% = 0.00

34
Grand Total = 0.0

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ THANK

YOU

Visit Again !
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1. Display Menu

2. Order food 3.Logout

Enter your choice :

Process finished with exit code 0

Explanation:
An inventory control system is critical for managing stock and supplies. Proper testing
ensures the system functions accurately and efficiently.

Result:
Upon completion of the experiment, you will have a well-structured test plan and a set of
test cases ready for testing the Inventory Control System.

35
Experiment 5: Execute the Test Cases against a Client-Server or Desktop Application
and Identify the Defects

Aim:
The aim of this experiment is to execute the test cases against a client-server or
desktop application and identify defects.

Algorithm:
1. Test Environment Setup: Set up the testing environment, including the client-server or
desktop application, required hardware, and test data.

2. Test Case Execution: Execute the test cases designed in Experiment 2 against the application.

3. Defect Identification: During test execution, record any discrepancies or issues encountered.

4. Defect Reporting: Log the identified defects with detailed information, including
steps to reproduce, severity, and priority.

5. Defect Tracking: Track the progress of defect resolution and verify fixes as they
are implemented.

6. Retesting: After defect fixes, retest the affected areas to ensure the issues are resolved.

7. Regression Testing: Conduct regression testing to ensure new changes do not introduce
new defects.

36
Test Case Table:

Expecte Actual
Process No. Test Case Steps Description Status d Result Result Commen
t

User can
Test Case 1. Launch Verify user Not successfull
Executio TC001 User Login the login Started y log in.
n application. process.
2. Enter
valid login
credentials.

3. Click on the
"Login"
button.

Invalid
data shows
1. Access Verify data appropriate
a data validation Not error
TC002 Data input on the form. Started messages.
Validation form.
2. Enter
invalid data in
the form
fields.
3. Submit
the form.

1. Access Verify file File is


the file upload Not uploaded
TC003 File Upload upload functionality Started successfully
feature. . .
2. Select a
file from the
system.

3. Click on
the "Upload"
button.

37
Application
Verify the gracefully
Network 1. application' Not handles
TC004 Connectivit Disconnect s response. Started disconnection
y the network. .
2. Attempt
to perform
an action
requiring
network
access.

1. Simulate Verify Application


Concurren concurrent application Not performs
TC005 t Users user sessions. performance Started well under
. load.
2. Perform
actions
simultaneously
.
1. Test the Application
application Verify cross- works on
on different platform Not all
TC006 Compatibility platforms. compatibility Started specified
. platforms.
2. Execute
tests on
various
browsers.

1. Monitor Data is
network Verify correctly
Client-Server traffic communicatio Not transmitted
TC007 Communicatio between client n integrity. Started and
n and server. received.

Explanation:
Testing a client-server or desktop application ensures its functionality across different
platforms and environments.

38
39
Result:
Upon completion of the experiment, you will have a list of identified defects and their status
after resolution for the client-server or desktop application.

40
Experiment 6: Test the Performance of the E-commerce Application

Aim:
The aim of this experiment is to test the performance of the e-commerce
application www.amazon.in.

Algorithm:
1. Identify Performance Metrics: Determine the performance metrics to be measured,
such as response time, throughput, and resource utilization.

2. Define Test Scenarios: Create test scenarios that simulate various user interactions and
loads on the application.

3. Performance Test Setup: Set up the performance testing environment with


appropriate hardware and software.

4. Execute Performance Tests: Run the performance tests using the defined scenarios and
collect performance data.

5. Analyze Performance Data: Analyze the collected data to identify any performance
bottlenecks or issues.

6. Performance Tuning: Implement necessary optimizations to improve the


application's performance.

Performance Table:

Expect Actua
Process No. Test Steps Descripti Status ed l Comme
Case on Result Resul nt
t
TC00 Response 1. Access The home
Performan 1 the Measure page loads
Time for home page the within the
ce of response
Testing
HomePage the e- Specified
commerce response
Application. Not time
Started threshold.

41
Expecte Actua
Process No. Test Case Steps Descriptio Statu d l Commen
n s Result Resul t
t
2. Use a
performanc
e testing
tool to
record the
time.
3. Analyze
the recorded
data to
determine
response
time.
The
applicati
on can
handle
1. Simulate peak-
Throughp peak-hour hour
ut during traffic on Measure Not traffic
TC00 Peak the the Starte without
2 Hours application throughput d significa
. . nt delays.
2. Execute
performan
ce tests
during
peak
hours.
3. Analyze
the data to
determine
the
throughput.
Resource
1. Monitor utilizatio
CPU, n
memory, and Measure remains
Resource network resource Not within
TC00 Utilizatio usage during utilizatio Starte acceptabl
3 n testing. n. d e limits.

42
Expecte Actua
Process No. Test Case Steps Descriptio Statu d l Commen
n s Result Resul t
t
3. Analyze
the data to
assess
resource
utilization.
The
1. Simulate applicatio
multiple n remains
concurrent Measure stable and
Concurre users app Not responsiv
TC00 nt Users accessing the performan Starte e under
4 app. ce under d load.
load.
2. Increase
the number
of
concurrent
users
gradually.
3. Record
the
application's
behavior
with
increased
load.
Measur
1. Apply e The
maximum system system
load to test behavio recovers
Stress the system's r under Not gracefully
TC00 Testin breaking extrem Starte after
5 g point. e load. d stress is
removed.
2. Apply the
maximum
user load the
application
can handle.

3. Observe
the
application's
response
under stress.

43
Expecte Actua
Process No. Test Case Steps Descriptio Statu d l Commen
n s Result Resul t
t
Performan
ce
bottleneck
1. Identify s are
performanc addressed
e Improve and
Performan bottlenecks application Not application
TC00 ce Tuning and areas of performanc Starte performs
6 improveme e. d better.
nt.
2. Analyze
the
performance
test results.
3. Implement
necessary
optimizations
.

44
45
Explanation:
Performance testing helps to identify bottlenecks in the e-commerce application, ensuring it
can handle real-world user loads effectively.

Result:
Upon completion of the experiment, you will have performance test results and any
optimizations made to improve the application's performance.

46
Experiment 7: Automate the testing of e-commerce applications using Selenium.

Aim:
The aim of this task is to automate the testing of an e-commerce web application
(www.amazon.in) using Selenium WebDriver, which will help improve testing efficiency
and reliability.

Algorithm:
1. Set up the environment:
- Install Java Development Kit (JDK) and configure the Java environment variables.
- Install an Integrated Development Environment (IDE) like Eclipse or IntelliJ.
- Download Selenium WebDriver and the required web drivers for the browsers you
intend to test (e.g., ChromeDriver, GeckoDriver for Firefox).

2. Create a new Java project in the IDE:


- Set up a new Java project in the IDE and include the Selenium WebDriver library.

3. Develop test cases:


- Identify the key functionalities and scenarios to test in the e-commerce application.
- Design test cases covering various aspects like login, search, product details, add to
cart, checkout, etc.

4. Implement Selenium automation scripts:


- Write Java code using Selenium WebDriver to automate the identified test cases.
- Utilize different Selenium commands to interact with the web elements, navigate
through pages, and perform various actions.

5. Execute the automated test cases:


- Run the automated test scripts against the e-commerce application.
- Observe the test execution and identify any failures or defects.

47
6. Analyze the test results:
- Review the test execution results to identify any failed test cases.
- Debug and fix any issues with the automation scripts if necessary.

7. Report defects:
- Document any defects found during the automated testing process.
- Provide detailed information about each defect, including steps to reproduce and
expected results.

Program:

from selenium import webdriver


import time
import random import
unittest
import HtmlTestRunner
from Pages.HomePage import HomePage
from Pages.PhonePDAPage import PhonePDAPage from
Pages.iPhonePage import iPhonePage
from Pages.LaptopPage import LaptopPage from
Pages.HPpage import HPpage
from Pages.CheckoutPage import CheckoutPage from
Pages.SuccessPage import SuccessPage

class EcomTest(unittest.TestCase):

@classmethod
def setUpClass(cls) -> None:
# initialize webdriver
cls.driver =
webdriver.Chrome("C:/Users/flavi/PycharmProjects/eCommerceAutomationProject/drivers/chromedriver
.exe")
cls.driver.implicitly_wait(10) cls.driver.maximize_window()

def test_01(self):
#Initialize driver and open URL driver =
self.driver
driver.get('http://tutorialsninja.com/demo/')

#Initialize Home Page Object and click phone and pda option home
= HomePage(driver)
home.click_phone_pda_option()
time.sleep(2)

#Select iphone - quantity 2 phone_pda =


PhonePDAPage(driver)
phone_pda.click_iphone_option()

48
time.sleep(2)
#See all images
iphone = iPhonePage(driver)
iphone.click_iphone_image()
time.sleep(2)
#Click next arrow 5 times for i in
range(5):
iphone.click_next_arrow() time.sleep(2)
#Take screenshot of last image and close image

driver.save_screenshot('C:/Users/flavi/PycharmProjects/eCommerceAutomationProject/Screenshots/'+'scr
eenshot#'+str(random.randint(0,101))+'.png')
iphone.click_close_button()

time.sleep(2)
#Add input quantity and add to cart
iphone.input_quantity(2) time.sleep(2)
#iphone.click_add_to_cart_button()
#time.sleep(2)

#Select laptop - quantity 1


home.hover_laptop_notebook_option()
home.click_show_all_laptop_notebook_option() time.sleep(2)
#Select hp
lap = LaptopPage(driver)
lap.click_hp_option()
#Once in hp page, scroll down hp =
HPpage(driver)
hp.scroll_to_add_to_cart_button()
#Click calendar and choose date and add to cart
hp.click_delivery_date_calendar()
hp.change_delivery_date_calendar("31", "December 2022")
hp.click_add_to_cart_button()

#Checkout Process #Click cart


and view cart
home.click_cart_button()
home.click_checkout_cart_button()
#Completing checkout details
cp = CheckoutPage(driver) cp.complete_checkout_options()
cp.complete_billing_details('fname', 'lname', 'test@email.com', '5555555555', '123 ABC', 'TestCity',
'12342', 'India', 'Goa')
cp.complete_delivery_method()
cp.complete_payment_method()
cp.confirm_order_method() #Final
Message
sp = SuccessPage(driver)
sp.print_message()

@classmethod
def tearDownClass(cls) -> None:
cls.driver.close() cls.driver.quit()
49
print("Test Completed")

#HtmlTestRunner.HTMLTestRunner(output="C:/Users/flavi/PycharmProjects/eCommerceAutomationPr
oject/Reports")

if name == ' main ':

unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="C:/Users/flavi/PycharmProjects/e
CommerceAutomationProject/Reports"))

50
Console output:

Result:
The successful completion of this task will yield:
- Automated test scripts for the e-commerce application using Selenium WebDriver.
- Identification of defects, if any, in the application.

51
Experiment 8: Integrate TestNG with the above test automation.

Aim:
The aim of this task is to integrate TestNG with the existing Selenium automation scripts
for the e-commerce application, enhancing test management, parallel execution, and
reporting capabilities.

Algorithm:
1. Set up TestNG in the project:
- Add TestNG library to the existing Java project.

2. Organize test cases using TestNG annotations:


- Add TestNG annotations (@Test, @BeforeTest, @AfterTest, etc.) to the existing test cases.
- Group similar test cases using TestNG's grouping mechanism.

3. Implement data-driven testing (optional):


- Utilize TestNG's data providers to implement data-driven testing if required.

4. Configure TestNG test suite:


- Create an XML configuration file for TestNG to define test suites, test groups, and
other configurations.

5. Execute the automated test cases using TestNG:


- Run the automated test suite using TestNG.
- Observe the test execution and identify any failures or defects.

6. Analyze the test results:

- Review the TestNG-generated test reports to identify any failed test cases.
- Utilize TestNG's reporting capabilities to understand the test execution status.

7. Report defects (if any):


- Document any defects found during the automated testing process.

52
Program:
import org.testng.annotations.Test;

import org.testng.annotations.BeforeMethod;

import org.testng.annotations.AfterMethod; import

org.testng.annotations.BeforeClass;

import.Time

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.testng.annotations.AfterClass;

public class FirstTestWithTestNGFramework {

WebDriver driver;

@BeforeClass

public void testSetup()

System.setProperty("webdriver.chrome.driver", ".\\Driver\\chromedriver.exe");

driver=new ChromeDriver();

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

driver.manage().window().maximize();

53
public void openBrowser()

driver.get("https://www.browserstack.com/");

driver.findElement(By.id("signupModalButton")).click();

System.out.println("We are currently on the following URL" +driver.getCurrentUrl());

@Test(description="This method validates the sign up functionality")

public void signUp()

driver.findElement(By.id("user_full_name")).sendKeys("user_name");

driver.findElement(By.id("user_email_login")).sendKeys("email_id");

driver.findElement(By.id("user_password")).sendKeys("password");

driver.findElement(By.xpath("//input[@name='terms_and_conditions']")).click();

driver.findElement(By.id("user_submit")).click();

@AfterMethod

public void postSignUp()

System.out.println(driver.getCurrentUrl());

@AfterClass

54
public void afterClass()

driver.quit();

55
Result:

The successful completion of this task will yield:

- Integration of TestNG with the existing Selenium automation scripts.

- Enhanced test management and reporting capabilities.

- Identification of defects, if any, in the application and improved efficiency in handling test

scenarios.

- Provide detailed information about each defect, including steps to reproduce and expected

results.

56

You might also like