Case Tools &Software Testing Lab Manual
Case Tools &Software Testing Lab Manual
1. Introduction to UML
Vision
To acknowledge quality education and instill high patterns of discipline
making the students technologically superior and ethically strong
which involves the improvement in the quality of life in human race.
Mission
To achieve and impart holistic technical education using the best of
infrastructure, outstanding technical and teaching expertise to
establish the students into competent and confidentengineers.
Evolving the center of excellence through creative and innovative
teaching learning practices for promoting academic achievement to
produce internationally accepted competitive and world class
professionals.
PROGRAMME EDUCATIONAL OBJECTIVES (PEOs)
2. To facilitate the graduates with the technical skills that prepare them for
immediate employment and pursue certification providing a deeper
understanding of the technology in advanced areas of computer science and
related fields, thus encouraging to pursue higher education and research based
on their interest.
3. To facilitate the graduates with the soft skills that include fulfilling the mission,
setting goals, showing self-confidence by communicating effectively, having a
positive attitude, get involved in team-work, being a leader, managing their
career and their life.
After the completion of the course, B. Tech Computer Science and Engineering, the
graduates will have the following Program Specific Outcomes:
1. Students are advised to come to the laboratory at least 5 minutes before (to the
starting time), those who come after 5 minutes will not be allowed into the lab.
2. Plan your task properly much before to the commencement, come prepared to the lab
with the synopsis / program / experiment details.
3. Student should enter into the laboratory with:
a. Laboratory observation notes with all the details (Problem statement, Aim,
Algorithm, Procedure, Program, Expected Output, etc.,) filled in for the labsession.
b. Laboratory Record updated up to the last session experiments and other utensils (if
any) needed in the lab.
c. Proper Dress code and Identity card.
4. Sign in the laboratory login register, write the TIME-IN, and occupy the computer
system allotted to you by the faculty.
5. Execute your task in the laboratory, and record the results / output in the lab
observation note book, and get certified by the concerned faculty.
6. All the students should be polite and cooperative with the laboratory staff, must
maintain the discipline and decency in the laboratory.
7. Computer labs are established with sophisticated and high end brandedsystems,
which should be utilized properly.
8. Students / Faculty must keep their mobile phones in SWITCHED OFF mode during
the lab sessions. Misuse of the equipment, misbehaviors with the staff and systems
etc., will attract severe punishment.
9. Students must take the permission of the faculty in case of any urgency to go out ; if
anybody found loitering outside the lab / class without permission during working
hours will be treated seriously and punished appropriately.
10. Students should LOG OFF/ SHUT DOWN the computer system before he/she leaves
the lab after completing the task (experiment) in all aspects. He/she must ensure the
system / seat is kept properly.
Course Outcomes:
Upon the completion of practical course Case tools & Software testing Lab, the student
will be able to attain the following things:
1. Able to understand the history, cost of using and building CASE tools.
2. Ability to construct and evaluate hybrid CASE tools by integrating existing tools.
3. Understand the myths and facts of software testing.
4. Analyze and design test cases using black box testing technique which includes
decision tables domain testing and transition testing.
5. Analyze and design test cases for a white box testing technique which includes path
testing, data flow graphs and matrix representation for a given problem.
6. Execute how to run test script wizard and Execute how to do performance testing using
testing tools including Winrunner and JMeter respectively.
7. Demonstrate the importance of testing and its role in need of software development
1. Introduction to UML
Introduction
CASE tools known as Computer-aided software engineering tools is a kind of
component- based development which allows its users to rapidly develop information
systems. The main goal of case technology is the automation of the entire information
systems development life cycle process using a set of integrated software tools, such as
modelling, methodology and automatic code generation. Component based
manufacturing has several advantages over custom development. The main advantages
are the availability of high quality, defect free products at low cost and at a faster time.
The prefabricated components are customized as per the requirements of the customers.
The components used are pre-built, ready-tested and add value and differentiation by
rapid customization to the targeted customers. However the products we get from case
tools are only a skeleton of the final product required and a lot of programming must be
done by hand to get a fully finished, good product. Characteristics of CASE:
Some of the characteristics of case tools that make it better than customized
development are;
Introduction
The unified modeling language (UML) is a standard language for writing software blue
prints of the system.
Definition:
• Visualizing
• Specifying
• Constructing
• Documenting
10
the artifacts of a software system.
• UML is a language that provides vocabulary and the rules for combing words in that
vocabulary for the purpose of communication.
• Vocabulary and rules of a language tell us how to create and real well formed models,
but they don‟t tell you what model you should create and when should create them.
1. Things
2. Relationships
3. Diagrams
Things are abstractions that are first-class citizens in a model; Relationships tie these things
together;
Diagrams group interesting collections of things.
Things
Things are the most important building blocks of UML. There are four kinds of things in the UML.
1. Structural things
2. Behavioral things
3. Grouping things
4. Annotational things
1) STRUCTURAL THINGS:
W in dow
ori gin
S ize
O pen() C
los e () Disp
l ay()
Interface:
An interface is a collection of operations that specify a service of a class or component. An
interface describes the externally visible behavior of that element.
Graphically the interface is rendered as a circle together with its name.
<<Interface>>
Mous eLis tener
(from event)
mous eClicked() m
ous ePres sed() mous
eReleas ed() mous
eEntered() mous I Window
eExited()
Collaboration:
Collaboration defines an interaction and is a society of roles and other elements that work
together to provide some cooperative behavior that‟s bigger than the sum of all the elements.
Graphically, collaboration is rendered as an ellipse with dashed lines, usually including only its
name as shown below.
Chain of
Responsibility
UseCase:
Use case is a description of a set of sequence of actions performed by a system for a specific
goal for the system.
Graphically, Use Case is rendered as an ellipse with dashed lines, usually including only its
name as shown below.
Login
12
ActiveClass:
An active class is a class whose objects own one or more processes or threads and therefore
can initiate control activity.
Graphically, an active class is rendered just like a class, but with heavy lines usually including
its name, attributes and operations as shown below.
Event
Management
Suspend()
Flush()
Component:
Component is a physical and replaceable part of a system that conforms to and provides the
realization of a set of interfaces.
Graphically, a component is rendered as a rectangle with tabs, usually including only its name,
as shown below.
orderform.java
Node:
A Node is a physical element that exists at run time and represents a computational resource,
generally having at least some memory and often, processing capability.
Graphically, a node is rendered as a cube, usually including only its name, as shown below.
server
2) BEHAVIORAL THINGS:
Behavioral things are the dynamic parts of UML models.
These are the verbs of a model, representing behavior over time and space.
13
1) Interaction:
An interaction is a behavior that consists of a set of messages exchanged among a set of
objects(elements) within a particular context to accomplish a specific task.
Graphically, a message is rendered as a direct line, almost always including the name if its
operation, as shown below.
Display
2) State Machine:
A state machine is a behavior that specifies the sequence of states of an object in its life cycle.
It defines the sequence of states an object goes through in response to events.
Graphically, a state is rendered as a rounded rectangle usually including its name and its sub-
states, if any, as shown below.
Waiting
3) GROUPING THINGS:
Grouping things are the organizational parts of the UML models. These are the boxes into
which a model can be decomposed.
There is one primary kind of grouping thing with “package”.
Package:
A package is a general-purpose mechanism for organizing elements into groups.
Package is the only one grouping thing available for gathering structural and behavioral things.
Business Rules
Package
4) ANNOTATIONAL THINGS:
Annotational things are the explanatory parts of the UML models.
Annotational things can be defined as a mechanism to capture remarks, descriptions, and
comments of UML model elements.
Note:
14
A note is simply a symbol for rendering constraints and comments attached to an element or a
collection of elements.
Graphically a note is represented as a rectangle with dog-eared corner together, with a textual
or graphical comment, as shown below.
Note
RELATIONSHIPSINTHEUML:
Relationship is another most important building block of UML. It shows how elements
are associated with each other and this association describes the functionality of an
application. There are four kinds of relationships in the UML:
1. Dependency
2. Association
3. Generalization
4. Realization
Dependency
Dependency is a relationship between two things in which change in one element also
affects the other one.
Dependency
Ex:
Dependent Class Independent Classs
Association:
Association is basically a set of links that connects elements of an UML model. It also
describes how many objects are taking part in that relationship.
1 Multipicity 1..n
A B
Rolename Rolename
Association
Ex:
15
1
Generalization:
Ex:
Parent Class
Realization:
Realization can be defined as a relationship in which two elements are connected. One
element describes some responsibility which is not implemented and the other one
implements them. This relationship exists in case of interfaces.
Ex:
<<Interface>>
TVSet Remote
DIAGRAMSINUML:
All the elements, relationships are used to make a complete UML diagram and the diagram
represents a system.
The visual effect of the UML diagram is the most important part of the entire process.
Each UML diagram is designed to let developers and customers view a software system from a
different perspective and in varying degrees of abstraction.
UML diagrams are the ultimate output of the entire system.
16
A diagram is the graphical presentation of a set of elements ,most often rendered as a
connected graph of vertices(things) arcs (relationships).
1) Class diagram
2) Object diagram
3) Use case diagram
4) Sequence diagram
5) Collaboration diagram
6) Activity diagram
7) State chart diagram
8) Deployment diagram
9) Component diagram
1. Class Diagram
Class diagram is a diagram that shows a set of classes, interfaces, and collaborations
and their relationships. Class diagrams address the static design view or the static process
view of the system.
Graphically it is represented as follows:-
School Department
Student
2. Object Diagram
Object diagram shows a set of objects and their relationships. These diagram the static design
view or static process view of a system.
3. Usecase Diagram
Use Case diagram shows a set of use cases and actors (a special kind of class) and their relationships.
These diagrams address the static use case view of a system. Graphically it is represented as follows:-
17
4. Sequence Diagram
Sequence diagram are interaction diagrams. This diagram emphasizes the time-
ordering of messages. These diagrams address the dynamic view of a system. Sequence
Diagram displays the time sequence of the objects participating in the interaction. This
consists of the vertical dimension (time) and horizontal dimension (different
objects).Graphically it is represented as
follows:-
:Person :Bottle
openBottle()
drinkWater()
closeBottle()
5 Collaboration Diagram
Collaboration diagram are also interaction diagrams. These diagrams emphasizes the structural
organization of the objects that send and receive messages. These diagrams address the dynamic
view of a system. Collaboration Diagram displays an interaction organized around the objects
and their links to one another. Numbers are used to show the sequence of messages.Graphically
it is
represented as follows:-
2: drinkWater()
:Bottle :Person
1: openBottle()
3: closeBottle()
6. Statechart Diagram
State chart diagram shows a state machine, consisting of states, transitions, events and
activities. These diagrams address the dynamic view of the system. State Chart diagram
displays the sequences of states that an object of an interaction goes through during its life in
response to received stimuli, together with its responses and actions.
7 .Activity Diagram
Activity diagram is a special kind of a state chart diagram that shows the flow from activity to activity
within a system. These diagrams address dynamic view of a system. Activity Diagram displays a special
18
state diagram where most of the states are action states and most of the transitions are triggered by
completion of the actions in the source states. Graphically it is represented as follows:-
8. Component Diagram
fraudagent.exe
fraudagent.dll
9. Deployment Diagram
Deployment diagram shows the configuration of run-time processing nodes and the components that
live on them. These diagrams address the static deployment view of architecture. Deployment Diagram
displays the configuration of run-time processing elements and the software components, processes,
and objects that live on them. Software component instances represent run-time
manifestations of code.
Graphically it is represented as
follows:-
Admin Client
admin.exe
<<10-T Ethernet>>
Server
Exam Client
<<RS-232>> exam.exe
19
2.Automatic Teller Machine (ATM)
Description of ATM System
The software to be designed will control a simulated automated teller machine (ATM) having a
magnetic stripe reader for reading an ATM card, a customer console (keyboard and display) for
interaction with the customer, a slot for depositing envelopes, a dispenser for cash, a printer for
printing customer receipts, and a key-operated switch to allow an operator to start or stop the machine.
The ATM will communicate with the bank‟s computer over an appropriate communication link. (The
software on the latter is not part of the requirements for this problem.)
The ATM will service one customer at a time. A customer will be required to insert an ATM card and
enter a personal identification number (PIN) – both of which will be sent to the bank for validation as
part of each transaction. The customer will then be able to perform one or more transactions. The card
will be retained in the machine until the customer indicates that he/she desires no further transactions,
at which point it will be returned – except as noted below.
The ATM must be able to provide the following services to the customer:
1. A customer must be able to make a cash withdrawal from any suitable account linked to the
card. Approval must be obtained from the bank before cash is dispensed.
2. A customer must be able to make a deposit to any account linked to the card, consisting of cash
and/or checks in an envelope. The customer will enter the amount of the deposit into the ATM,
subject to manual verification when the envelope is removed from the machine by an operator.
Approval must be obtained from the bank before physically accepting the envelope.
3. A customer must be able to make a transfer of money between anytwo accounts linked to the
card.
4. A customer must be able to make a balance inquiry of any account linked to thecard.
5. A customer must be able to abort a transaction in progress bypressing the Cancel key instead
of responding to a request from the machine.
The ATM will communicate each transaction to the bank and obtain verification that it was allowed
by the bank. Ordinarily, a transaction will be considered complete by the bank once it has been
approved. In the case of a deposit, a second message will be sent to the bank indicating that the
customer has deposited the envelope. (If the customer fails to deposit the envelope within the timeout
period, or presses cancel instead, no second message will be sent to the bank and the deposit will not
be credited to the customer.)
20
If the bank determines that the customer‟s PIN is invalid, the customer will be required to re-enter the
PIN before a transaction can proceed. If the customer is unable to successfully enter the PIN after
three tries, the card will be permanently retained by the machine, and the customer will have to contact
the bank to get it back.
If a transaction fails for any reason other than an invalid PIN, the ATM will display an explanation of
the problem, and will then ask the customer whether he/she wants to do another transaction.
The ATM will provide the customer with a printed receipt for each successful transaction, showing the
date, time, machine location, type of transaction, account(s), amount, and ending and available
balance(s) of the affected account (“to” account for transfers).
The ATM will have a key-operated switch that will allow an operator to start and stop the servicing of
customers. After turning the switch to the “on” position, the operator will be required to verify and
enter the total cash on hand. The machine can only be turned off when it is not servicing a customer.
When the switch is moved to the “off” position, the machine will shut down, so that the operator may
remove deposit envelopes and reload the machine with cash, blank receipts, etc.
Objectives
The objective of this software is similar to ATM software installed in ATM center. It should
first validate the pin in the ATM card. Then the type of transaction is enquired and the information
from the customer is validated. If it is a withdrawal the amount is asked. After the money is delivered
the transaction just made is updated in the database where the customer‟s information is stored.
Scope
The scope of the project is to design an ATM system that will help in completely automatic
banking this software is going to be designed for withdrawal and deposit of money and register the
transaction in the database where the customer‟s information is stored.
21
A) Name of the experiment: Class diagram for ATMSystem
Purpose:
The purpose of the class diagram is to model the static view of an application. The class diagrams are
the only diagrams which can be directly mapped with object oriented languages and thus widely used
at the time of construction. The UML diagrams like activity diagram, sequence diagram can only give
the sequence flow of the application but class diagram is a bit different. So it is the most popular UML
diagram in the coder community. So the purpose of the class diagram can be summarized as:
Contents:
• Classes
• Interfaces
• Collaborations
• Dependency, generalization and association relationships
Procedure:-
Step1: First Classes are created.
Step2: Named as PinValid, Account Type, Transaction, Update, Server, Customer classes are
created.
Step3: Appropriate relationships are provided between them as association.
22
CLASS DIAGRAM:
Inferences:
Applications:
Online transaction
Online banking
23
RECORD NOTES
24
25
26
B) NAME OF EXPERIMENT: Use case diagram for ATMSystem.
AIM: To design and implement ATM System through Use case Diagram.
Purpose:
The purpose of use case diagram is to capture the dynamic aspect of a system. Because other four
diagrams (activity, sequence, collaboration and State chart) are also having the same purpose. So we
will look into some specific purpose which will distinguish it from other four diagrams. Use case
diagrams are used to gather the requirements of a system including internal and external influences.
These requirements are mostly design requirements. So when a system is analyzed to gather its
functionalities use cases are prepared and actors are identified.
Procedure:
Step3: A use case Enter PIN, Withdraw money is created and connected with user as association
relationship.
Step4: Similarly various use cases like Deposit money, Balance Enquiry, Manage Account etc are
created and appropriate relationships are associated with each of them.
27
DIAGRAM:
Enter PIN
Withdraw Money
Balance enquiry
ATM admin
Customer
Deposit
Abort/ Cancel
Print Receipt
Manage Account
Withdrawal UseCase
A withdrawal transaction asks the customer to choose a type of account to withdraw from (e.g.
checking) from a menu of possible accounts, and to choose an amount from a menu of possible
amounts. The system verifies that it has sufficient money on hand to satisfy the request before sending
the transaction to the bank. (If not, the customer is informed and asked to enter a different amount.) If
the transaction is approved by the bank, the appropriate amount of cash is dispensed by the machine
before it issues a receipt. A withdrawal transaction can be cancelled by the customer pressing the
Cancel key any time prior to choosing the amount.
Deposit UseCase
A deposit transaction asks the customer to choose a type of account to deposit to (e.g. checking) from
a menu of possible accounts, and to type in amount on the keyboard. The transaction is initially sent to
the bank to verify that the ATM can accept a deposit from this customer to this account. Ifthe
28
transaction is approved, the machine accepts an envelope from the customer containing cash and/or
checks before it issues a receipt. Once the envelope has been received, a second message is sent to the
bank, to confirm that the bank can credit the customer‟s account – contingent on manual verification
of the deposit envelope contents by an operator later.
A deposit transaction can be cancelled by the customer pressing the Cancel key any time prior to
inserting the envelope containing the deposit. The transaction is automatically cancelled if the
customer fails to insert the envelope containing the deposit within a reasonable period of time after
being asked to do so.
Inquiry UseCase
An inquiry transaction asks the customer to choose a type of account to inquire about from a menu of
possible accounts. No further action is required once the transaction is approved by the bank before
printing the receipt. An inquiry transaction can be cancelled by the customer pressing the Cancel key
any time prior to choosing the account to inquire about.
Validate UserUsecase:
This use case is for validate the user i.e. check the pin number, when the bank reports that the
customer‟s transaction is disapproved due to an invalid PIN. The customer is required to re-enter the
PIN and the original request is sent to the bank again. If the bank now approves the transaction, or
disapproves it for some other reason, the original use case is continued; otherwise the process of re-
entering the PIN is repeated. Once the PIN is successfully re-entered
If the customer fails three times to enter the correct PIN, the card is permanently retained, a screen is
displayed informing the customer of this and suggesting he/she contact the bank, and the entire
customer session is aborted.
PrintBill usecase
This usecase is for printing corresponding bill after transactions (withdraw or deposit, or balance
enquiry, transfer) are completed.
ManageAccount
This use case is for updating corresponding user accounts after transactions (withdraw or deposit or
transfer) are completed.
RESULT:
Inferences:
1. Identification of use cases.
2. Identification of actors.
29
RECORD NOTES
30
31
32
INTERACTION DIAGRAMS
We have two types of interaction diagrams in UML. One is sequence diagram and the other is
a collaboration diagram. The sequence diagram captures the time sequence of message flow from one
object to another and the collaboration diagram describes the organization of objects in a system
taking part in the message flow.
So the following things are to be identified clearly before drawing the interaction diagram:
Purpose:
Objects
Focus of control
Messages
Life line
Objects
Links
Messages
33
C) NAME OF EXPERIMENT: Sequence diagram for ATMSystem.
Step4: In sequence diagram interaction is done through time ordering of messages. So appropriate
messages are passed between user and ATM is as shown in the figure.
DIAGRAM:
ATM ADMIN
check pin no
pin valid/invalid
check account
display status
check amount
display status
Update account
34
RECORD NOTES
35
36
37
D) NAME OF EXPERIMENT: collaboration for ATMSystem.
Procedure:-
Step4: So appropriate messages are passed between user and ATM as shown in the figure.
DIAGRAM:
1: check pin no
3: check account
5: check amount
7: update account
ATM ADMIN
2: pin valid/invalid
4: display status
6: display status
38
RECORD NOTES
39
40
41
WITHDRAW UseCase:
SEQUENCE DIAGRAM
2: Validate Pin
3: Validate
4: Choose Transaction
5: Withdraw
6: Check Balance
7: Sufficiant Balance
8: Creadit cash
9: Insufficiant Balance
COLLABORATION DIAGRAM
5: Withdraw
8: Creadit cash : ATM
10: Low balance machine
3: Validate
7: Sufficiant Balance
9: Insufficiant Balance
2: Validate Pin
6: Check Balance
: Bank
server
42
ENQUIRY UseCase:
SEQUENCE DIAGRAM:
2: Obtain Pin
3: Enter Pin
4: Send Pin
5: Request
7: Type
9: seif
43
COLLABARATION DIAGRAM:
custome
r
1: Insert Card
7: Type
9: seif
3: Enter Pin
5: Request
6: Obtain types of enquiry
:session
11: Current bal
13: Previous trans
15: Display(a/c no,bal,names)
2: Obtain Pin
4: Send Pin
8: Get a/cno's
: Bank
10: Bal enquiry
server
12: Transactionhistory
14: View a/c details
DEPOSITUseCase:
SEQUENCE DIAGRAM:
2: Obtain Pin
3: Enter Pin
4: Validate Pin
5: Valid Pin
7: Deposit Amt
44
COLLABORATION DIAGRAM:
1: Insert card
3: Enter Pin
custome 7: Deposit Amt
r
5: Valid Pin
4: Validate Pin
: Bank
server
STATECHART Diagram
State Chart diagram is used to model dynamic nature of a system. They define different states of an
object during its lifetime. And these states are changed by events. State chart diagram describes the
flow of control from one state to another state.
States are defined as a condition in which an object exists and it changes when some event is
triggered. But the main purpose is to model reactive system.
Contents
• Simply state and composite states
• Transitions, including events and actions
AIM: To design and implement ATM System through State Chart diagram.
Purpose:
45
3. To describe different states of an object during its life time.
4. Defines a state machine to model states of an object.
Procedure:-
Step1: First after initial state control undergoes transition to ATM screen.
Step2: After inserting card it goes to the state wait for pin.
Step4:. In this way it undergoes transitions to various states and finally reaches the ATM screen state
as shown in the fig.
DIAGRAM:
S
T
A
T
E
C
H
A
R
T
F
O
R
A
T
M
>
0
]
46
47
RECORD NOTES
48
49
50
F) NAME OF EXPERIMENT: Activity diagram forATM System.
THEORY: An activity diagram shows the flow from activity to activity .An activity is an ongoing non
atomic execution within a state machine .Activities ultimately results in some action, which is made up
of executable atomic computations. We can use these diagrams to model the dynamic aspects of a
system.
Activity diagram is basically a flow chart to represent the flow form one activity to another . The
activity can be described as an operation of the system. So the control flow is drawn from one
operation to another. This flow can be sequential, branched or concurrent. Activity diagrams deals
with all type of flow by using elements like fork, join etc.
Contents
Fork
A fork represents the splitting of a single flow of control into two or more concurrent Flow of control.
A fork may have one incoming transition and two or more outgoing transitions, each of which
represents an independent flow of control. Below fork the activities associated with each of these path
continues in parallel.
Join
A join represents the synchronization of two or more concurrent flows of control. A join may have
two or more incoming transition and one outgoing transition. Above the join the activities associated
with each of these paths continues in parallel.
Branching
A branch specifies alternate paths takes based on some Boolean expression Branch is represented by
diamond Branch may have one incoming transition and two or more outgoing one on each outgoing
transition, you place a Boolean expression shouldn‟t overlap but they should cover all possibilities.
Swimlane:
Swimlanes are useful when we model workflows of business processes to partition the activity states
on an activity diagram into groups. Each group representing the business organization responsible for
those activities, these groups are called Swimlanes .
51
Procedure:-
52
DIAGRAM: Activity diagram for Transactions:
53
ACTIVITY DIAGRAM
Inferences:
54
RECORD NOTES
55
56
57
NAME OF EXPERIMENT: Component diagram for ATMSystem.
THEORY:
Component diagrams are used to model physical aspects of a system. Physical aspects are the
elements like executables, libraries, files, documents etc which resides in a node. So component
diagrams are used to visualize the organization and relationships among components in a system.
These diagrams are also used to make executable systems.
Purpose:
Before drawing a component diagram the following artifacts are to be identified clearly:
• Use a meaningful name to identify the component for which the diagram is to be drawn.
• Prepare a mental layout before producing using tools.
• Use notes for clarifying important points.
Contents
Procedure:-
Step3: In it various components such as withdraw money, deposit money, check balance, transfer
money etc. are created.
58
DIAGRAM:
customer ATM
account Machine
bank
balance
withdraw enquiry
checking saving
account account
Purpose:
Deployment diagrams are used to visualize the topology of the physical components of a system
where the software components are deployed. So deployment diagrams are used to describe the static
deployment view of a system. Deployment diagrams are used for describing the hardware
components where software components are deployed. Component diagrams and deployment
diagrams are closely related. Component diagrams are used to describe the components and
deployment diagrams shows how they are deployed in hardware.
Procedure:-
Step1: First user node is created
59
Step2: various nodes withdraw money, deposit money, and check balance, transfer money
etc. are created.
Step4: Association relationship is established between user and other nodes.
Step5: Dependency is established between deposit money and check balance.
Atm machine
location -A
console
bank
Atm machine
server
location b
60
RECORD NOTES
61
62
63
SOFTWARE TESTING METHODOLOGY LAB
EXPERIMENT: 1
NAME OF THE EXPERIMENT: Write program in C language to demonstrate the working of
the following constructs
i.)do..while:
Syntax:
Iteration-statement:
do
{
Statements
while( expression ) ;
Example:
#include<stdio.h>
#include<conio.h>
#include <stdio.h>
main()
{
nt i = 10;
do{
printf("Hello %d\n", i );
i = i -1;
if( i == 6 )
{
break;
}
}while ( i > 0 );
}
64
ii.) while
while(condition)
{
Loop body
Increment or decrement;
}
Example:
#include<stdio.h>
int main()
{
int counter, howmuch;
scanf("%d", &howmuch);
counter = 0;
while ( counter < howmuch)
{
counter++;
printf("%d\n", counter);
}
return 0;
}
iii) if…else
syntax:
if( condition 1 )
statement1;
else if( condition 2 )
statement2;
else if( condition 3 )
statement3;
else
statement4;
65
Example:
#include<stdio.h>
int main(){
int x,y;
printf("Enter value for x :");
scanf("%d",&x);
printf("Enter value for y :");
scanf("%d",&y);
if ( x > y ){
printf("X is large number - %d\n",x);
}
else{
printf("Y is large number - %d\n",y);
}
return 0;
}
iv) switch
syntax
swithch(int/char const)
{
Case const 1:stm1;
Break;
Case const 2:stmt2;
Break;
}
}
default: stmt n;
Break;
}
Example:
#include <stdio.h>
int main() {
int color = 1;
printf("Please choose a color(1: red,2: green,3: blue):\n");
scanf("%d", &color);
switch (color)
{
66
case 1:
printf("you chose red color\n");
break;
case 2:
printf("you chose green color\n");
break;
case 3:
printf("you chose blue color\n");
break;
default:
printf("you did not choose any color\n");
}
return 0;
}
v) for Syntax:
Example:
#include <stdio.h>
int main()
{
int x;
/* The loop goes while x < 10, and x increases by one every loop*/ for ( x = 0; x
< 10; x++ )
{
printf( "%d\n", x );
}
getchar();
}
67
Record Notes
68
69
70
EXPERIMENT: 2
NAME OF THE EXPERIMENT:
Write a C program that uses functions to perform the following:
i) Multiplication of Two Matrices*/
#include<stdio.h>
#include<conio.h>
Void main()
{
int a[10][10], b[10][10], m[10][10], i, j, p, q, r, s, k; clrscr ();
printf(―enter the size of A Matrix‖);
scanf(―%d %d‖, &p, &q);
printf(―Enter the size of B Matrix ‖);
scanf(―%d %d ―, &r, &s);
if(q=r)
{
printf(―Enter the elements of matrix A:\n‖);
for(i=0; i<p; i++)
{
for(j=0; j<q; j++)
{
scanf(―%d‖, &a[i][j]);
}
}
printf(―Enter the elements of matrix b:\n‖); for(i=0;
i<r; i++)
{
for(j=0; j<s; j++)
{
scanf(―%d‖, &b[i][j]);
}
}
for (i=0; i<p; i++)
{
for(j=0; j<s; j++)
{
m[i][j]=0;
for(k=0; k<q; k++)
{
m[i][j] =m[i][j] +a[i][j] * b[k][j];
}
}}
72
Record Notes
73
74
75
EXPERIMENT: 3
NAME OF THE EXPERIMENT: Test Cases for Functionalities of ATM system
Purpose:
This document describes the software requirements and specification (SRS) for an automated
teller machine (ATM) network. The document is intended for the customer and the developer
(designers, testers, maintainers). The reader is assumed to have basic knowledge of banking accounts
and account services. Knowledge
and understanding of Unified Modeling Language (UML) diagrams is also required.
Scope:
The software supports a computerized banking network called ‗Bank24„. The network enables
customers to complete simple bank account services via automated teller machines (ATMs) that may
be located off premise and that need not be owned and operated by the customer„s bank. The ATM
identifies a customer by a cash card and password. It collects information about a simple account
transaction (e.g., deposit, withdrawal, transfer, bill payment), communicates the transaction
information to the customer„s bank, and dispenses cash to the customer. The banks provide their own
software for their own computers. The
‗Bank24„ software requires appropriate record keeping and security provisions. The software must
handle concurrent accesses to the same account correctly.
Intended Audience:
The intended audience of this SRS consists of:
Software designers
Systems engineers
Software developers
Software testers
Customers
The actors of the system are:
1. User
2. ATM Machine
3. Bank
Product Perspective:
An automated teller machine (ATM) is a computerized telecommunications device that provides the
customers of a financial institution with access to financial transactions in a public space without the
need for a human clerk or bank teller. On most modern ATMs, the customer is identified by inserting
a plastic ATM card with a magnetic stripe or a plastic smartcard with a chip, that contains a unique
card number and some security information, such as an expiration date or CVC (CVV). Security is
provided by the customer entering a personal identification number (PIN).
Product functions:
Using an ATM, customers can access their bank accounts in order to make cash withdrawals (or
credit
card cash advances) and check their account balances.
The functions of the system are:
1. Login
2. Get Balance Information
3. Withdraw Cash
4. Transfer Funds
Operating Environments:
The hardware,software and technology used should have following specifications:
Ability to read the ATM card.
Ability to count the currency notes.
Touch screen for convenience.
76
Keypad(in case touchpad fails)
Continuous power supply.
Ability to connect to bank„s network.
Ability to validate user.
Design/implementation constraints:
Login:
Validate Bank Card
Validate for Card Expiration Date
Validate that the card's expiration date is later than today's date
If card is expired, prompt error message "Card is expired"
Validate for Stolen or Lost Card
Validate that the card is not reported lost or stolen
77
complete their banking transactions without any assistance.
Hardware interfaces
The hardware should have following specifications:
Ability to read the ATM card
Ability to count the currency notes
Touch screen for convenience
Keypad (in case touchpad fails)
Continuous power supply
Ability to connect to bank„s network
Ability to take input from user
Ability to validate user
Software interfaces
The software interfaces are specific to the target banking software systems. At present, two known
banking systems will participate in the ATM network.
State Bank
Indian Overseas Bank
Safety requirements:
Must be safe kept in physical aspects, say in a cabin
Must be bolted to floor to prevent any kind of theft
Must have an emergency phone outside the cabin
There must be an emergency phone just outside the cabin
The cabin door must have an ATM card swipe slot
The cabin door will always be locked, which will open only when user swipes his/her ATM
card in the slot & is validated as genuine
Security requirements:
Users accessibility is censured in all the ways
Users are advised to change their PIN on first use
Users are advised not to tell their PIN to anyone
The maximum number of attempts to enter PIN will be three
Some of the possible Bugs on ATM machine?
1. 1.Successful insertion of ATM card
2. Unsuccessful operation due to insert card in wrong angle
3. Unsuccessful operation due to invalid account Ex: other bank card or time expired card
4. successful entry of PIN number
5. un successful operation due to enter wrong PIN number 3times
6. successful selection of language
7. successful selection of account type
8. unsuccessful operation due to invalid account type
9. successful selection of withdraw operation
10. successful selection of amount to be withdrawl
11. successful withdraw operation
78
12. unsuccessful withdraw operation due to wrong denominations
13. unsuccessful withdraw operation due to amount is greater than day limit
14. unsuccessful withdraw operation due to lack of money in ATM
15. unsuccessful withdraw operation due to amount is greater than possible balance
16. unsuccessful withdraw operation due to transactions is greater than day limit
17. unsuccessful withdraw operation due to click cancel after insert card
18. unsuccessful withdraw operation due to click cancel after insert card & pin number
19. unsuccessful withdraw operation due to click cancel after insert card , pin number & language
20. unsuccessful withdraw operation due to click cancel after insert card , pin number , language
&account type
21. unsuccessful withdrawal operation due to click cancel after insert card , pin number ,
language ,account type & withdrawal operation
22. unsuccessful withdrawal operation due to click cancel after insert card , pin number,
language ,account type ,withdrawal operation &amount to be withdraw.
79
Record Notes
80
81
82
EXPERIMENT: 4
83
1) Requirement Gathering:
Requirement gathering phase involves documentation of requirements either as Functional
Specifications or Use Cases. Requirements are gathered as per customer needs and documented by
Banking Experts or Business Analyst. To write requirements on more than one subject experts are
involved as banking itself has multiple sub domains and one full fledge banking application will be
the integration of all. For Example: A banking application may have separate modules for Transfers,
Credit Cards, Reports, Loan Accounts, Bill Payments, Trading Etc.
2) Requirement Review:
The deliverable of Requirement Gathering is reviewed by all the stakeholders such as QA Engineers,
Development leads and Peer Business Analysts. They cross check that neither existing business
workflows nor new workflows are violated.
3) Business Scenario Preparations:
In this stage QA Engineers derive Business Scenarios from the requirement documents (Functions
Specs or Use Cases); Business Scenarios are derived in such a way that all Business Requirements are
covered. Business Scenarios are high level scenarios without any detailed steps, further these Business
Scenarios are reviewed by Business Analyst to ensure all of Business Requirements are met and its
easier for BAs to review high level scenarios than reviewing low level detailed Test Cases.
Information Technology
Page 85
Four phases are:
i) Inception
ii) Collaboration
iii) Construction and
iv) Transition
RUP widely involves IBM Rational tools.
In this article we discussed how complex a Banking application could be and what are the typical
phases involved in testing the application. Apart from that we also discussed current trends
followed by IT industries including software development methodologies and tools.
Test cases for opening bank account
1. Input parameters checking -
Name
-Date of Birth -
Photo -Address
Proof -Identity
proof
-Introducers (if applicable) -
PAN card
-Initial deposit
-Whether checkbook / ATM card / Online banking facilities are needed or not -Customer
signature
Type of account -
Savings account -Salary
account -Joint account -
Current account -
Secondary account -RD
account
-Account for a company
Test cases
-Checking mandatory input parameters -Checking
optional input parameters -Check whether able to
create account entity.
-Check whether you are able to deposit an amount in the newly created account (and thus updating the
balance)
-Check whether you are able to withdraw an amount in the newly created account (after deposit) (and
thus updating the balance)
-Check whether company name and its pan number and other details are provided in case of salary
account
-Check whether primary account number is provided in case of secondary account
-Check whether company details are provided in cases of company's current account
-Check whether proofs for joint account is provided in case of joint account
-Check whether you are able deposit an account in the name of either of the person in an joint
Information Technology
Page 86
account.
-Check whether you are able withdraw an account in the name of either of the person in an joint
account.
-Check whether you are able to maintain zero balance in salary account
-Check whether you are not able to maintain zero balance (or mini balance) in non-salary account.
viva questions
1. Can you explain boundary value analysis?
2. Can you explain equivalence partitioning?
3. Can you explain random/monkey testing?
4. What are semi-random test cases?
5. What is negative and positive testing?
6. How did you define severity ratings in your project?
Page | 87
Record Notes
Page | 88
Page | 89
Page | 90
EXPERIMENT: 5
NAME OF THE EXPERIMENT: Test plan document for Library Management System
The Library Management System is an online application for assisting a librarian in managing a book
library in a University. The system would provide basic set of features to add/update clients,
add/update books, search for books, and manage check-in / checkout processes. Our test group tested
the system based on the requirement specification.
INTRODUCTION
This test report is the result for testing in the LMS. It mainly focuses on two problems: what we will
test and how we will test.
Result
GUI test
Pass criteria: librarians could use this GUI to interface with the backend library database without any
difficulties
Result: pass
Database test
Pass criteria: Results of all basic and advanced operations are normal (refer to section 4)
Result: pass
Basic function test
Add a student
Pass criteria:
Each customer/student should have following attributes: Student ID/SSN (unique), Name,
Address and Phone number.
Result: pass
The retrieved customer information by viewing customer detail should contain the four attributes.
Result: pass
Update/delete student
Pass criteria:
The record would be selected using the student ID Result:
pass
Updates can be made on full. Items only: Name, Address, Phone number Result: pass
The record can be deleted if there are no books issued byuser.
Result: Partially pass. When no books issued by user, he can be deleted. But when there are
books Issued by this user, he was also deleted. It is wrong.
The updated values would be reflected if the same customer's ID/SSN is called for.
Result: pass
If customer were deleted, it would not appear in further search queries.
Result: pass
Add a book
Pass criteria:
Each book shall have following attributes: Call Number, ISBN, Title, Author name.
Result: pass
The retrieved book information should contain the four attributes.
Result: pass
Update/delete book
Pass criteria:
The book item can be retrieved using the call number Result: did not
pass. Can not retrive using the call number
The data items which can be updated are: ISBN, Title, Author name Result: passThe book can be deleted
Page | 91
only if no user has issued it.
Result: partially pass. When no user has issued it, pass. When there are user having issued it,
did not pass
The updated values would be reflected if the same call number is called for Result: pass
If book were deleted, it would not appear in further search queries. Result: pass
Search for book
Pass criteria:
The product shall let Librarian query books„ detail information by their ISBN number or Author
or Title.
Result: pass
The search results would produce a list of books, which match the search parameters with
following Details: Call number, ISBN number, Title, Author Result: pass
The display would also provide the number of copies which is available for issue Result: pass
The display shall provide a means to select one or more rows to a user-list Result: pass
A detailed view of each book should provide information about check-in/check out status, with
the borrower„s information.
Result: pass
The search display will be restricted to 20 results per page and there would be means to navigate
from sets of search results.
Result: pass
The user can perform multiple searches before finally selecting a set of books for check in or
checkout. These should be stored across searches.
Result: pass
A book may have more than one copy. But every copy with the same ISBN number should have
same detail information.
Result: pass
The borrower„s list should agree with the data in students„ account
Result: pass
Check-in book
Pass criteria:
Librarians can check in a book using its callnumber
Result: pass
The check-in can be initiated from a previous search operation where user has selected a set of
books.
Result: pass
The return date would automatically reflect the current system date. Result: did not
pass.
Any late fees would be computed as difference between due date and return date at rate of 10
cents a day.
Result: did not pass
A book, which has been checked in once, should not be checked in again Result: pass
Check-out book
Pass criteria:
Librarians can check out a book using its call number Result: pass
The checkout can be initiated from a previous search operation where user has selected a set of
books.
Result: pass
The student ID who is issuing the book would be entered
Result: pass
The issue date would automatically reflect the current system date. Result: did not
pass
Page | 92
The due date would automatically be stamped as 5 days from current date. Result: did not
pass
A book, which has been checked out once, should not be checked out again Result: pass
A student who has books due should not be allowed to check out any books Result: did not
pass
The max. No of books that can be issued to a customer would be 10. The system should not allow
checkout of books beyond this limit.
Result: pass
View book detail
Pass criteria:
This view would display details about a selected book from search operation Result: pass
The details to be displayed are: Call number, IBN, Title, Author, Issue status (In library or
checked out), If book is checked out it would display, User ID & Name, Checkout date, Due date
Result: for checkout date and due date, did not pass
Books checked in should not display user summary
Result: pass
Books checked out should display correct user details. Result:
pass
View student detail
Pass criteria:
Librarians can select a user record for detailed view Result:
pass
The detail view should show:
Page | 93
Record Notes
Page | 94
Page | 95
Page | 96
EXPERIMENT: 6
NAME OF THE EXPERIMENT: Study of Any Testing Tool( Jmeter)
Why JMeter?
Have you ever tested a web server to know how efficiently it works? How many concurrent users can a web server handle?
Let say that one day, your boss asks you to do performance testing of www.google.com for 100 users. What would you do?
Page | 97
It's not feasible to arrange 100 people with PC and internet access simultaneously accessing google.com Think of the
infrastructure requirement when you test for 10000 users (a small number for a site like google). Hence you need a software
tool like JMeter that will simulate real-user behaviors and performance/load test your site.
JMeter Advantages
Open source license: JMeter is totally free, allows developer use the source code for the development
Friendly GUI: JMeter is extremely easy to use and doesn't take time to get familiar with it
Platform independent: JMeter is 100% pure Java desktop application. So it can run on multiple platforms
Full multithreading framework. JMeter allows concurrent and simultaneous sampling of different functions by a
separate thread group
Visualize Test Result: Test result can be displayed in a different format such as chart, table, tree and log file
Easy installation: You just copy and run the *.bat file to run JMeter. No installation needed.
Highly Extensible: You can write your own tests. JMeter also supports visualization plugins allow you to extend
your testing
Multiple testing strategy: JMeter supports many testing strategies such as Load Testing, Distributed Testing,
and Functional Testing.
Simulation: JMeter can simulate multiple users with concurrent threads, create a heavy load against web application
under test
Support multi-protocol: JMeter does not only support web application testing but also evaluate database server
performance. All basic protocols such as HTTP, JDBC, LDAP, SOAP, JMS, and FTP are supported by JMeter
Record & Playback - Record the user activity on the browser and simulate them in a web application using JMeter
Script Test: Jmeter can be integrated with Bean Shell & Selenium for automated testing.
JMeter simulates a group of users sending requests to a target server, and return statistics information of target server through
graphical diagrams
Page | 98
The completed workflow of JMeter as shown in the figure below
Page | 99
JMeter can be used to test the performance of both static resources such as JavaScript and HTML, as well
as dynamic resources, such as JSP, Servlets, and AJAX.
JMeter can discover maximum number of concurrent users that your website can handle
JMeter provides a variety of graphical analyses of performance reports.
Load Testing: Modeling the expected usage by simulating multiple user access the Web services concurrently.
Stress Testing: Every web server has a maximum load capacity. When the load goes beyond the limit, the web server
starts responding slowly and produce errors. The purpose of the Stress Testing is to find the maximum load the web
server can handle.
The figure below shows how JMeter load Testing simulates the heavy load:
Page | 100
Step 1) Add Thread Group
1. Start JMeter
2. Select Test Plan on the tree
3. Add Thread Group
Right click on the "Test Plan" and add a new thread group: Add -> Threads (Users) -> Thread Group
Number of Threads: 100 (Number of users connects to the target website: 100)
Loop Count: 10 (Number of time to execute testing)
Ramp-Up Period: 100
Page | 101
Ramp-Up Period tells JMeter how long to delay before starting the next user. For example, if we have 100 users and a 100-
second Ramp-Up period, then the delay between starting users would be 1 second (100 seconds /100 users)
This element can be added by right-clicking on the Thread Group and selecting: Add -> Config Element -> HTTP Request
Defaults.
In the HTTP Request Defaults control panel, enter the Website name under test (http://www.google.com)
HTTP Request
Right-click on Thread Group and select: Add -> Sampler -> HTTP Request.
Page | 102
In HTTP Request Control Panel, the Path field indicates which URL request you want to send to Google server.
For example, if you enter "calendar" in Path field. JMeter will create the URL request http://www.google.com/calendar to
Google server
If you keep the Path field blank JMeter will create the URL request http://www.google.com to Google server.
In this test, you keep the Path field blank to make JMeter create the URL request http://www.google.com to Google
server.
Right click Test Plan, Add -> Listener -> Graph Results
The picture below presents a graph of a test plan, where we simulated 100 users who accessed on website www.google.com.
Page | 103
At the bottom of the picture, there are the following statistics, represented in colors:
To analyze the performance of the web server under test, you should focus on 2 parameters
Throughput
Deviation
The Throughput is the most important parameter. It represents the ability of the server to handle a heavy load.
The higher the Throughput is, the better is the server performance.
Page | 104
In this test, the throughput of Google server is 1,491.193/minute. It means Google server can handle 1,491.193 requests per
minute. This value is quite high so we can conclude that Google server has good performance
The deviation is shown in red - it indicates the deviation from the average. The smaller the better.
Let compare the performance of Google server to other web servers. This is the performance test result of
website http://www.yahoo.com/ (You can choose other websites)
The throughput of a website under test http://www.yahoo.com is 867.326/minutes. It means this server handle 867.326
requests per minute, lower than Google.
The deviation is 2689, much higher than Google (577). So we can determine the performance of this website is less than a
Google server.
NOTE: The above values depend on several factors like current server load at Google, your internet speed, your CPU power
etc. Hence, it's very unlikely that you will get the same results as above.
Troubleshooting:
If you face the issue while running the above scenario ... do the following
1. Check whether you are connecting to the internet via a proxy. If yes, remove the proxy.
2. Open a new instance of Jmeter
3. Open the PerformanceTestPlan.jmx in Jmeter
4. Double Click on Thread Group -> Graph Result
5. Run the Test
Page | 105
Record Notes
Page | 106
Page | 107
Page | 108
EXPERIMENT: 7
NAME OF THE EXPERIMENT: Study of any web testing tool (e.g. Selenium)
What is Selenium?
JavaScript framework that runs in your web browser Works anywhere JavaScript is supported
Hooks for many other languages Java, Ruby, Python Can simulate a user navigating through pages
and then assert for specific marks on the pages All you need to really know is HTML to start using it
right away
Selenium IDE
Selenium Integrated Development Environment (IDE) is a Firefox plugin that lets testers to record
their actions as they follow the workflow that they need to test.
It provides a Graphical User Interface for recording user actions using Firefox which is used to learn
and use Selenium, but it can only be used with Firefox browser as other browsers are not supported.
However, the recorded scripts can be converted into various programming languages supported by
Selenium and the scripts can be executed on other browsers as well.
Selenium- IDEDownload
Step 1 − Launch Firefox and navigate to the following URL - http://seleniumhq.org/download/.
Under the Selenium IDE section, click on the link that shows the current version number as shown
below.
Step 2 − Firefox add-ons notifier pops up with allow and disallow options. User has to allow the
installation.
Page | 109
Step 3 − The add-ons installer warns the user about untrusted add-ons. Click 'InstallNow'.
Step 4 − The Selenium IDE can now be accessed by navigating to Tools >>Selenium IDE.
Step 5 − The Selenium IDE can also be accessed directly from the quick access menu bar as shown
below.
The following image shows the features of Selenium IDE with the help of a simple tool-tip.
Page | 110
The features of the record tool bar are explained below.
Page | 111
Record This features helps user to Records
the user's browser actions.
The following steps are involved in creating Selenium tests using IDE −
Step 1 − Launch the Firefox browser and navigate to the website - https://www.ncalculators.com/
Step 2 − Open Selenium IDE from the Tools menu and press the record button that is on the top-
right corner.
Step 3 − Navigate to "Math Calculator" >> "Percent Calculator >> enter "10" as number1 and 50 as
number2 and click "calculate".
Page | 112
Step 4 − User can then insert a checkpoint by right clicking on the webelement and select "Show all
available commands" >> select "assert text css=b 5"
Step 5 − The recorded script is generated and the script is displayed as shown below.
The test can also be saved with an extension htm, shtml, and xhtml.
Page | 113
Savingthe Test Suite
A test suite is a collection of tests that can be executed as a single entity.
Step 1 − Create a test suite by navigating to "File" >> "New Test Suite" as shown below.
Step 2 − The tests can be recorded one by one by choosing the option "New Test Case" from the
"File" Menu.
Page | 114
Step 3 − The individual tests are saved with a name along with saving a "Test
Suite".
Step 1 − The Run status can be seen in the status pane that displays the number of tests passed and
failed.
Step 2 − Once a step is executed, the user can see the result in the "Log" Pane.
Step 3 − After executing each step, the background of the test step turns "Green" if passed and "Red"
if failed as shown below.
Debugging is the process of finding and fixing errors in the test script. It is a common step in any
script development. To make the process more robust, we can make use a plugin "Power Debugger"
Page | 115
for Selenium IDE.
Step 2 − Now launch 'Selenium IDE' and you will notice a new icon, "Pause on Fail" on recording
toolbar as shown below. Click it to turn it ON. Upon clicking again, it would be turned "OFF".
Step 3 − Users can turn "pause on fail" on or off any time even when the test is running.
Step 4 − Once the test case pauses due to a failed step, you can use the resume/step buttons to
continue the test execution. The execution will NOT be paused if the failure is on the last command
of any test case.
Step 5 − We can also use breakpoints to understand what exactly happens during the step. To insert a
breakpoint on a particular step, "Right Click" and select "Toggle Breakpoint" from the context-
sensitive menu.
Page | 116
Step 6 − Upon inserting the breakpoint, the particular step is displayed with a pause icon as shown
below.
Step 7 − When we execute the script, the script execution is paused where the breakpoint is inserted.
This will help the user to evaluate the value/presence of an element when the execution is in
progress.
Page | 117
Inserting Verification Points
This section describes how to insert verification points in Selenium IDE.
The test cases that we develop also need to check the properties of a web page. It requires assert and
verify commands. There are two ways to insert verification points into the script.
To insert a verification point in recording mode, "Right click" on the element and choose "Show all
Available Commands" as shown below.
We can also insert a command by performing a "Right-Click" and choosing "Insert New Command".
Page | 118
After inserting a new command, click 'Command' dropdown and select appropriate verification point
from the available list of commands as shown below.
Given below are the mostly used verification commands that help us check if a particular step has
passed or failed.
verifyElementPresent
assertElementPresent
verifyElementNotPresent
assertElementNotPresent
verifyText
assertText
verifyAttribute
assertAttribute
verifyChecked
assertChecked
Page | 119
verifyAlert
assertAlert
verifyTitle
assertTitle
SynchronizationPoints
During script execution, the application might respond based on server load, hence it is required for
the application and script to be in sync. Given below are few a commands that we can use to ensure
that the script and application are in sync.
waitForAlertNotPresent
waitForAlertPresent
waitForElementPresent
waitForElementNotPresent
waitForTextPresent
waitForTextNotPresent
waitForPageToLoad
waitForFrameToLoad
Like locators, patterns are a type of parameter frequently used by Selenium. It allows users to
describe patterns with the help of special characters. Many a time, the text that we would like to
verify are dynamic; in that case, pattern matching is very useful.
Pattern matching is used with all the verification point commands - verifyTextPresent, verifyTitle,
verifyAlert, assertConfirmation, verifyText, and verifyPrompt.
globbing
regular expressions, and
exact patterns.
Globbing
Most techies who have used file matching patterns in Linux or Windows while searching for a
certain file type like *.doc or *.jpg. would be familiar with term "globbing"
Page | 120
[ ] − called a character class, lets you match any single character found within thebrackets.
[0-9] matches any digit.
To specify a glob in a Selenium command, prefix the pattern with the keyword 'glob:'. For example,
if you would like to search for the texts "tax year 2013" or "tax year 2014", then you can use the golb
"tax year *" as shown below.
However the usage of "glob:" is optional while specifying a text pattern because globbing patterns
are the default in Selenium.
Exact Patterns
Patterns with the prefix 'exact:' will match the given text as it is. Let us say, the user wants an exact
match with the value string, i.e., without the glob operator doing its work, one can use the 'exact'
pattern as shown below. In this example the operator '*' will work as a normal character rather than a
pattern-matching wildcard character.
Regular Expressions
Regular expressions are the most useful among the pattern matching techniques available. Selenium
supports the complete set of regular expression patterns that Javascript supports. Hence the users are
no longer limited by *, ? and [] globbing patterns.
To use RegEx patterns, we need to prefix with either "regexp:" or "regexpi:". The prefix "regexpi" is
case-insensitive. The glob: and the exact: patterns are the subsets of the Regular Expression patterns.
Everything that is done with glob: or exact: can be accomplished with the help of RegExp.
Example
For example, the following will test if an input field with the id 'name' contains the string 'tax year',
'Tax Year', or 'tax Year'.
Page | 121
Command Target Value
It is easy to extend Selenium IDE by adding customized actions, assertions, and locator-strategies. It
is done with the help of JavaScript by adding methods to the Selenium object prototype. On startup,
Selenium will automatically look through the methods on these prototypes, using name patterns to
recognize which ones are actions, assertions, and locators.
Let us add a 'while' Loop in Selenium IDE with the help of JavaScript.
Step 2 − Now launch 'Selenium IDE' and navigate to "Options" >> "Options" as shown below.
Step 3 − Click the 'Browse' button under 'Selenium Core Extensions' area and point to the js file that
we have saved in Step 1.
Page | 122
Step 4 − Restart Selenium IDE.
Step 5 − Now you will have access to a few more commands such as "Label", "While" etc.
Step 6 − Now we will be able to create a While loop within Selenium IDE and it will execute as
shown below.
Viva questions:
1. What is Selenium?
2. What are the different Selenium components?
3. What are the testing types that can be supported by Selenium?
4. What are the limitations of Selenium?
5. What is Selenese?
Record Notes
EXPERIMENT: 8
NAME OF THE EXPERIMENT: Write a test cases for a) Gmail application b) Face book Manually .