STA LAB - Updated-1
STA LAB - Updated-1
CCS366
(R-2021)
VI SEMESTER
DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING
To serve the young minds by providing Quality Professional education in Engineering and
Technology.
MISSION
To render the quality professional education through a Learner - Centric approach to empower the
students in professional ethics, social responsibilities and enabling the students to meet the challenges
in thefield of Engineering and Technology.
VISION
To become a centre of learning by focusing on the emerging trends in the fields of Computer Science
and Engineering.
MISSION
To impart quality technical education through an effective Learner -Centric approach with Modern Tool Usage,
to meet the challenges in the field of Computer Science and Engineering.
PROGRAM EDUCATIONAL OBJECTIVES (PEOs)
1. Fundamentals
2. Core Competence
To provide students with sound knowledge in engineering and experimental skills to identify
complex software problems in industry and to develop practical solution for them
3. Breadth
To provide relevant training and experience to bridge the gap between theory and practice
this enables to find solutions for real time problem in industry and organization and to design
products requiring interdisciplinary skills
4. Professionalism skills
To bestow students with adequate training and provide opportunities to work as team that will
build up their communication skills, individual leadership and supportive qualities and to
develop them to adapt and work in ever changing technologies
5. Lifelong Learning
PSO 2: To build up programming, analytical and logical thinking abilities by using creative
graphic tools and deep learning.
PSO 3: To gain ability to communicate scientific information in a clear and concise manner
which will be reliable and interpretable for the forthcoming opportunities and limitation through
lifelong learning that is beyond our knowledge.
g) To communicate in verbal and written form with fellow engineers and society at large
h) To understand the impact of Computer Science and Engineering in the society and
demonstrate awareness of contemporary issues and commitment to give solutions
exhibiting social responsibility
3.Know the location of the fire extinguisher and the first aid box.
5.Do not open the system unit casing or monitor casing particularly when the powered is turned on.
Some internal components hold electric voltages of up to 30,000 volts which can be fatal.
6.Do not insert metal objects such as clips, pins and needles into the computer casings. They may
cause fire.
7.Do not remove anything from the computer laboratory without permission.
8.do not touch, connect or disconnect any plug or cable without your lecturer/laboratory technician’s
permission.
10.Try not to touch any of the circuit boards and power sockets when a device is connected to them.
CCS366 SOFTWARE TESTING AND AUTOMATION LABORATORY
SYLLABUS
1. Develop the test plan for testing an e-commerce web/mobile application (www.amazon.in).
4. Develop the test plan and design the test cases for an inventory control system.
5. Execute the test cases against a client server or desktop application and identify the defects.
9. Mini Project:
COURSE OBJECTIVES
The student should be made to:
1. Develop the test plan for testing an e-commerce web/mobile application (www.amazon.in).
2. Design the test cases for testing the e-commerce application
3. Test the e-commerce application and report the defects in it.
4. Develop the test plan and design the test cases for an inventory control system.
5. Execute the test cases against a client server or desktop application and identify the defects.
6. Test the performance of the e-commerce application.
7. Automate the testing of e-commerce applications using Selenium.
8. Integrate TestNG with the above test automation.
9. Mini Project:
a) Build a data-driven framework using Selenium and TestNG
b) Build Page object Model using Selenium and TestNG c
c) Build BDD framework with Selenium, TestNG and Cucumber
COURSE OUTCOMES
Table of Contents:
1. Test Plan Identifier.......................................................................................................................................
2. Introduction .................................................................................................................................................
3. Features to be tested .....................................................................................................................................
4. Test Cases ....................................................................................................................................................
5. Approach .....................................................................................................................................................
6. Pass/Fail Criteria ..........................................................................................................................................
7. Suspension criteria and resumption requirements .........................................................................................
8. Test deliverables ..........................................................................................................................................
Procedure:
2. Introduction
The goal of this document is to develop a test plan for online shopping website Amazon. This document
defines all the procedures and activities required to prepare for testing of the functionalities of the system
which are specified in QA technical test document. The objective of the test plan are to define the activities to
perform the testing, define the test deliverables documents involved in testing.
3. Features to be tested
The following list of features to be tested in this test cycle.
Product Search
Recommendations
Shopping Basket
Product listings, navigation
4. Test Cases
TestCases_Amazon.
xlsx
5. Approach
This section describes the overall approach of the testing which ensures that the each feature and the
combination of the features are adequately tested. The major tasks that are used are
Manual Testing: Manual Testing will be done to ensure the correctness of various parts of the code using test
cases generated by the tester.
Automation Testing: Using selenium web drivertool, we automate these manual test case then execute to
reduce manual work at regression testing area.
6. Pass/Fail Criteria
The pass or fail of a test depends on whether the system meets with all the functional requirements. Test cases
executed on the Online Amazon store will pass if they meet the specific requirements.
7. Suspension criteria and resumption requirements
Suspension criteria: If the system contains one or more critical defects,the entire system should be
suspended. The testing may also be suspended if the hardware and software components required are
not available on time. The failed test cases should be recorded along with the description for failure.
Resumption requirements: When a new version of the system is transmitted to the test group after a
suspension of testing has occurred, all previous tests will be rerun to ensure program changes have not
inadvertently affected other portions of the program.
8. Test deliverables
The following documents are the available test deliverables
Test plan
Test case specifications
Test input and output data
Test logs
Pre-requisites Test Step Test Step Expected Result Actual Status Comments Defect
Data No. Result ID
Browser should Userna 1 Open Browser should be opened
be installed me- browser
Internet Userna 2 Open url Ecommerce website should be 123
connection me opened
should be Passwor 3 Enter user should be able to input
present d- username username and password
passwor and
d password
4 Click on Home page should be
login button displayed after login
Browser should 1 Open Browser should be opened
be installed browser
Internet 2 Open url Ecommerce website should be
connection opened
should be 3 Enter user should be able to input
present username username and password
User should be and
logged in password
4 Click on Home page should be
login button displayed after login and user
name should be displayed on
home page
Browser should 1 Open Browser should be opened
be installed browser
Internet 2 Open url Ecommerce website should be
connection opened
should be 3 Enter user should be able to input
present username username and password
User should be and
logged in password
4 Click on Home page should be
login button displayed after login and user
name should be displayed on
home page
Browser should 1 Open Browser should be opened
be installed browser
Internet 2 Open url Ecommerce website should be
connection opened
should be 3 Enter user should be able to input
present username username and password
User should be and
logged in password
4 Click on User should be logged in and
login button Search functionality is present
on home page.
Browser should 1 Open Browser should be opened
be installed browser
Internet 2 Open url Ecommerce website should be
connection opened
should be 3 Enter user should be able to input
present username username and password
User should be and
logged in password
4 Click on User should be logged in and
login button home page should be same on
different browsers.
Browser should 1 Open Browser should be opened
be installed browser
Internet 2 Open url Ecommerce website should be
connection opened
should be 3 Enter user should be able to input
present username username and password
User should be and
logged in password
4 Click on User should be logged in and
login button alignment of products on
home page should be proper.
Browser should 1 Open Browser should be opened
be installed browser
Internet 2 Open url Ecommerce website should be
connection opened
should be 3 Enter user should be able to input
present username username and password
User should be and
logged in password
4 Click on Home page should be
login button displayed after login and user
name should be displayed on
home page
5 Click on any User should be redirected to
product product specification page.
displayed on
home page
Browser should 1 Open Browser should be opened
be installed browser
Internet
connection 2 Open url Ecommerce website should be
should be opened
present
3 Enter user should be able to input
User should be
username username and password
logged in
and
password
4 Click on Home page should be
login button displayed after login and user
name should be displayed on
home page
5 Click on any User should be redirected to
product product specification page.
displayed on
home page
Browser should 1 Open Browser should be opened
be installed browser
Internet 2 Open url Ecommerce website should be
connection opened
should be 3 Enter user should be able to input
present username username and password
User should be and
logged in password
4 Click on Home page should be
login button displayed after login and user
name should be displayed on
home page
5 Click on user User profile should be
name displayed.
displayed on
home page.
Browser should 1 Open Browser should be opened
be installed browser
Internet 2 Open url Ecommerce website should be
connection opened
should be 3 Enter user should be able to input
present username username and password
User should be and
logged in password
4 Click on Used should be logged in and
login button home page should be
displayed, products should be
categorised.
3. Test the e-commerce application and report the defects in it.
Pre-requisites Test Step Test Step Expected Result Actual Status Comments Defect
Data No. Result ID
Browser should Userna 1 Open Browser should be opened
be installed me- browser
Internet Userna 2 Open url Ecommerce website should be 123
connection me opened
should be Passwor 3 Enter user should be able to input
present d- username username and password
passwor and
d password
4 Click on Home page should be
login button displayed after login
Browser should 1 Open Browser should be opened
be installed browser
Internet 2 Open url Ecommerce website should be
connection opened
should be 3 Enter user should be able to input
present username username and password
User should be and
logged in password
4 Click on Home page should be
login button displayed after login and user
name should be displayed on
home page
Browser should 1 Open Browser should be opened
be installed browser
Internet 2 Open url Ecommerce website should be
connection opened
should be 3 Enter user should be able to input
present username username and password
User should be and
logged in password
4 Click on Home page should be
login button displayed after login and user
name should be displayed on
home page
Browser should 1 Open Browser should be opened
be installed browser
Internet 2 Open url Ecommerce website should be
connection opened
should be 3 Enter user should be able to input
present username username and password
User should be and
logged in password
4 Click on User should be logged in and
login button Search functionality is present
on home page.
Browser should 1 Open Browser should be opened
be installed browser
Internet 2 Open url Ecommerce website should be
connection opened
should be 3 Enter user should be able to input
present username username and password
User should be and
logged in password
4 Click on User should be logged in and
login button home page should be same on
different browsers.
Browser should 1 Open Browser should be opened
be installed browser
Internet 2 Open url Ecommerce website should be
connection opened
should be 3 Enter user should be able to input
present username username and password
User should be and
logged in password
4 Click on User should be logged in and
login button alignment of products on
home page should be proper.
Browser should 1 Open Browser should be opened
be installed browser
Internet 2 Open url Ecommerce website should be
connection opened
should be 3 Enter user should be able to input
present username username and password
User should be and
logged in password
4 Click on Home page should be
login button displayed after login and user
name should be displayed on
home page
5 Click on any User should be redirected to
product product specification page.
displayed on
home page
Browser should 1 Open Browser should be opened
be installed browser
Internet
connection 2 Open url Ecommerce website should be
should be opened
present
3 Enter user should be able to input
User should be username username and password
logged in and
password
4 Click on Home page should be
login button displayed after login and user
name should be displayed on
home page
5 Click on any User should be redirected to
product product specification page.
displayed on
home page
4. Develop the test plan and design the test cases for an inventory control system.
The test case generation of Inventory Management System Project is today’s topic of discussion in this post.
Login
Here, you can mention the Name of the test
Test Engineer:
engineer
Test Case ID: 1
Related
UC/FR/NFR
UC/FR/NFR
Date: 02-01-2014
The purpose of this test insure that the user can
Purpose:
log in with his id to use this app.
Pre-Req: The user enters his correct name and password
for a successful login page.
Test Data: sname, sid, spassword
The steps are below.
1. visit Login Page
2. enter UserId
3. enter password
Steps:
4. click login
5. recovery password
6. change password
7. keep login
Status: Pass
Main form
Here, you can mention the Name of the test
Test Engineer:
engineer
Test Case ID: 2
Related
UC/FR/NFR
UC/FR/NFR
Date: 03-01-2014
The purpose of this test is to make sure that the
Purpose: design of the front page of the app is consistent
and readable.
The main activity of the app should be up and
Pre-Req:
running.
Test Data: none (test is just visual test)
Following steps will take place in the test
1. Latest orders
2. Top customers
Steps: 3. Recent products
4. Recent customers
5. Graph by amount and order
6. Graph by day/month/year
Status: Pass
Employ Records
Here, you can mention the Name of the test
Test Engineer:
engineer
Test Case ID: 3
Related
UC/FR/NFR
UC/FR/NFR
Date: 03-01-2014
The purpose of this test for registered employ by
Purpose: his name, password, email, and mobile number
for use this app and work on the app.
Employ sure that login with his name and id to
Pre-Req:
use this app.
Test Data: none (test is just visual test)
Step formatting rules below.
1. enter employ name
Steps: 2. enter employ password
3. enter employ email
4. enter employ a mobile number
Status: Pass
Category Record
Here, you can mention the Name of the test
Test Engineer:
engineer
Test Case ID: 4
Related
UC/FR/NFR
UC/FR/NFR
Date: 04-01-2014
The purpose of this testing to insert, update,
Purpose:
delete and view category.
Pre-Req: The user enter category by its correct name.
5. Execute the test cases against a client server or desktop application and identify the defects.
CalcTest.txt
package cse.test;
import cse.com.*;
import org.junit.jupiter.api.Test;
class CalcTest {
@Test
void test1() {
assertEquals(15,Calculator.addition(10, 5));
}
@Test
void test2() {
assertEquals(2,Calculator.division(10, 5));
}
@Test
void test3() {
assertEquals(50,Calculator.multiplication(10, 5));
}
@Test
void test4() {
assertEquals(5,Calculator.subtraction(10, 5));
}
Calculator.txt
package cse.com;
import java.util.Scanner;
VERSION HISTORY
[Provide information on how the development and distribution of the Test Plan, up to the
final point of approval, was controlled and tracked. Use the table below to provide the
version number, the author implementing the version, the date of the version, the name of
the person approving the version, the date that particular version was approved, and a
brief description of the reason for creating the revised version.]
Versio Implemented Revision Approve Approval Reason
n By Date d Date
# By
1.0 <Author <mm/dd/yy <name> <mm/dd/yy Test Plan draft
name> > >
1 INTRODUCTION
PURPOSE OF THE TEST PLAN DOCUMENT
[Provide the purpose of the Test Plan Document. This document should be tailored to fit a
particular project’s needs.]
The Test Plan document documents and tracks the necessary information required to
effectively define the approach to be used in the testing of the project’s product. The Test
Plan document is created during the Planning Phase of the project. Its intended audience is
the project manager, project team, and testing team. Some portions of this document may
on occasion be shared with the client/user and other stakeholder whose input/approval into
the testing process is needed.
2 COMPATIBILITY TESTING
TEST RISKS / ISSUES
[Describe the risks associated with product testing or provide a reference to a document
location where it is stored. Also outline appropriate mitigation strategies and contingency
plans.]
ITEMS TO BE TESTED / NOT TESTED
[Describe the items/features/functions to be tested that are within the scope of this test
plan. Include a description of how they will be tested, when, by whom, and to what quality
standards. Also include a description of those items agreed not to be tested.]
Item to Test Test Description Test Date Responsibility
TEST APPROACH(S)
[Describe the overall testing approach to be used to test the project’s product. Provide an
outline of any planned tests.]
TEST APPROACH(S)
[Describe the overall testing approach to be used to test the project’s product. Provide an
outline of any planned tests.]
TEST REGULATORY / MANDATE CRITERIA
[Describe any regulations or mandates that the system must be tested against.]
TEST PASS / FAIL CRITERIA
[Describe the criteria used to determine if a test item has passed or failed its test.]
TEST ENTRY / EXIT CRITERIA
[Describe the entry and exit criteria used to start testing and determine when to stop
testing.]
TEST DELIVERABLES
[Describe the deliverables that will result from the testing process (documents, reports,
charts, etc.).]
TEST SUSPENSION / RESUMPTION CRITERIA
[Describe the suspension criteria that may be used to suspend all or portions of testing.
Also describe the resumption criteria that may be used to resume testing.]
TEST ENVIRONMENTAL / STAFFING / TRAINING NEEDS
[Describe any specific requirements needed for the testing to be performed
(hardware/software, staffing, skills training, etc).)]
Selenium is a robust set of tools that supports rapid development of test automation for
web-based applications. Selenium provides a rich set of testing functions specifically
geared to the needs of testing of a web application. These operations are highly flexible,
allowing many options for locating UI elements and comparing expected test results
against actual application behavior.
One of Selenium‘s key features is the support for executing one‘s tests on multiple
browser platforms.
Selenium Components
Selenium is composed of three major tools. Each one has a specific role in aiding
the development of web application test automation.
Selenium-RC provides an API (Application Programming Interface) and library for each
of its supported languages: HTML, Java, C#, Perl, PHP, Python, and Ruby. This ability
to use Selenium-RC with a high-level programming language to develop test cases also
allows the automated testing to be integrated with a project‘s automated build
environment.
Selenium-Grid
Selenium-Grid allows the Selenium-RC solution to scale for large test suites or test suites
that must be run in multiple environments. With Selenium-Grid, multiple instances of
Selenium-RC are running on various operating system and browser configurations; Each
of these when launching register with a hub. When tests are sent to the hub they are then
redirected to an available Selenium-RC, which will launch the browser and run the test.
This allows for running tests in parallel, with the entire test suite theoretically taking only
as long to run as the longest individual test.
* Tests developed on Firefox via Selenium-IDE can be executed on any other supported
browser via a simple Selenium-RC command line.
** Selenium-RC server can start any executable, but depending on browser security
settings there may be technical limitations that would limit certain features.
Selenium is highly flexible. There are multiple ways in which one can add functionality
to Selenium‘s framework to customize test automation for one‘s specific testing needs.
This is, perhaps, Selenium‘s strongest characteristic when compared with proprietary test
automation tools and other open source solutions. Selenium-RC support for multiple
programming and scripting languages allows the test writer to build any logic they need
into their automated testing and to use a preferred programming or scripting language of
one‘s choice.
Selenium-IDE allows for the addition of user-defined ―user-extensions‖ for creating
additional commands customized to the user‘s needs. Also, it is possible to re-configure
how the Selenium-IDE generates its Selenium-RC code. This allows users to customize
the generated code to fit in with their own test frameworks. Finally, Selenium is an Open
Source project where code can be modified and enhancements can be submitted for
contribution.
.Test Suites
A test suite is a collection of tests. Often one will run all the tests in a test suite as one
continuous batch-job.
When using Selenium-IDE, test suites also can be defined using a simple HTML file.
The syntax again is simple. An HTML table defines a list of tests where each row
defines the filesystem path to each test. An example tells it all.
<html>
<head>
<title>Test Suite Function Tests – Priority 1</title>
</head> <body>
<table>
<tr><td><b>Suite Of Tests</b></td></tr>
<tr><td><a href=‖./Login.html‖>Login</a></td></tr>
<tr><td><a href=‖./SearchValues.html‖>Test Searching for
Values</a></td></tr> <tr><td><a href=‖./SaveValues.html‖>Test
Save</a></td></tr>
</table>
</body> </html>
A file similar to this would allow running the tests all at once, one after another, from the
Selenium-IDE.
Test suites can also be maintained when using Selenium-RC. This is done via
programming and can be done a number of ways. Commonly Junit is used to maintain a
test suite if one is using Selenium-RC with Java. Additionally, if C# is the chosen
language, Nunit could be employed. If using an interpreted language like Python with
Selenium-RC than some simple programming would be involved in setting up a test
suite. Since the whole reason for using Sel-RC is to make use of programming logic for
your testing this usually isn‘t a problem.
Few typical Selenium commands.
Dependency List
1. Selenium- 4.12.1
2. Java 8 or above
3. TestNG – 7.8.0
4. Maven – 3.8.1
5. WebdriverManager – 5.5.3
Implementation Steps
Step 1- Download and Install Java
Selenium needs Java to be installed on the system to run the tests. Click here to learn How to install Java.
Step 2 – Download and setup Eclipse IDE on the system
The Eclipse IDE (integrated development environment) provides strong support for Java developers, which is
needed to write Java code. Click here to learn How to install Eclipse.
Step 3 – Setup Maven
To build a test framework, we need to add a number of dependencies to the project. It is a very tedious and
cumbersome process to add each dependency manually. So, to overcome this problem, we use a build
management tool. Maven is a build management tool that is used to define project structure, dependencies,
build, and test management. Click here to learn How to install Maven.
Step 4 – Create a new Maven Project
Click here to learn How to create a Maven project
Below is the Maven project structure. Here,
Group Id – com.example
Artifact Id – Selenium_TestNGDemo
Version – 0.0.1-SNAPSHOT
Package – com. example. Selenium_TestNGDemo
}
Step 7 – Test Execution through TestNG
Go to the Runner class and right-click Run As TestNG Test. The tests will run as TestNG tests.
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.
TestNG also produces an “index.html” report, and it resides under the test-output folder. The below image shows
the index.html report. This is the latest theme of the report.