Professional Documents
Culture Documents
-Semester V
M.C.A. SEMESTER-V
SOFTWARE TESTING
(Journal)
University of Mumbai
1 Roll No:193
M.C.A.-Semester V
University of Mumbai
Certificate
Examiner
2 Roll No:193
M.C.A.-Semester V
INDEX
3 Roll No:193
M.C.A.-Semester V
Practical No. 2
There is no provision for changed rate & There should be Module to show changed rate
customers feedback and space for customers feedback
There was a confusion in the terms that who is We can use code name system for employees
the customer and who is a employees of the of the hotel to avoid confusion.
hotel.
Function Requirement
1. Reservation/Booking
1.1. The system shall record reservations.
1.2. The system shall record the customers first name.
1.3. The system shall record the customers last name.
1.4. The system shall record the number of occupants.
1.5. The system shall record the room number.
1.6. The system shall display the default room rate.
1.6.1. The system shall allow the default room rate to be changed.
1.6.2. The system shall require a comment to be entered, describing the reason for
changing the default room rate.
1.7. The system shall record the customers phone number.
1.8. The system shall display whether or not the room is guaranteed.
1.9. The system shall generate a unique confirmation number for each reservation.
1.10. The system shall automatically cancel non-guaranteed reservations if the customer has
not provided their credit card number by 6:00 pm on the check-in date.
1.11. The system shall record the expected check-in date and time.
1.12. The system shall record the expected checkout date and time.
1.13. The system shall check-in customers.
1.14. The system shall allow reservations to be modified without having to reenter all the
customer information.
1.15. The system shall checkout customers.
1.15.1. The system shall display the amount owed by the customer.
1.15.2. To retrieve customer information the last name or room number shall be used
1.15.3. The system shall record that the room is empty.
1.15.4. The system shall record the payment.
1.15.5. The system shall record the payment type.
1.16. The system shall charge the customer for an extra night if they checkout after 11:00
a.m.
4 Roll No:193
M.C.A.-Semester V
1.17. The system shall mark guaranteed rooms as must pay after 6:00 pm on the check-in
date.
The system shall record customer feedback.
2. Food
2.1. The system shall track all meals purchased in the hotel (restaurant and room service).
2.2. The system shall record payment and payment type for meals.
2.3. The system shall bill the current room if payment is not made at time of service.
2.4. The system shall accept reservations for the restaurant and room service.
3. Management
3.1. The system shall display the hotel occupancy for a specified period of time (days;
including past, present, and future dates).
3.2. The system shall display projected occupancy for a period of time (days).
3.3. The system shall display room revenue for a specified period of time (days).
3.4. The system shall display food revenue for a specified period of time (days).
3.5. The system shall display an exception report, showing where default room and food
prices have been overridden.
3.6. The system shall allow for the addition of information, regarding rooms, rates, menu
items, prices, and user profiles.
3.7. The system shall allow for the deletion of information, regarding rooms, rates, menu
items, prices, and user profiles.
3.8. The system shall allow for the modification of information, regarding rooms, rates, menu
items, prices, and user profiles.
The system shall allow managers to assign user passwords
5 Roll No:193
M.C.A.-Semester V
Defects Comments/Suggestion
Customer has to fill number of forms and Try to ask for only necessary information from the
Information which makes the process tedious. customer so that the processing will be quicker.
There is no provision for providing updates to the There should be some email facilities to provide
customer. updates to the customer.
Functional Requirements:
FR10: The website should be simple to use for both client and staff so that a manual is not required for
either user, although some tool tips may be required on the administration side of the site.
6 Roll No:193
M.C.A.-Semester V
Practical No. 3
Sr. Requir Test Test Case Prereq Descrip Input data Expected Actual Resu
No ement Case Objective uisite tion Output Output lt
. Id
1 FR5 TCI A Theater Run as Enter Theater A staff user Staff users Pass
_1 name can applicat the Name Art should be are able to
be added ion details Centre, able to add add
to the and Town/City information theaters to
system click Aberystwyth, into the the system
submit Capacity system.
2500
2 FR5 TCI Only Run as Enter Login name: Only staff only Pass
_2 administrat applicat the Test user set as administrat
ors and ion details Password: administrat ors and
data entry and TestUser ors and data entry
staff can click data entry staff can
add submit staff should add
informatio be able to information
n gain access .
to add
information
3 FR6 TCI That a Run as select A staff user Movies Pass
_5 movie applicat movie should be information
informatio ion and able to can be
n can be click update edited.
updated delete information
button about a
movie that
exists in
the system.
4 FR6 TCI Only Run as Browse Browse Only staff only Pass
_6 administrat applicat direct direct link set as administrat
ors and ion link for for edit administrat ors and
data entry edit movies ors and data entry
staff can movies data entry staff can
edit staff should edit movies
movies be able to
gain access
to edit
movies.
7 Roll No:193
M.C.A.-Semester V
5 FR6 TCI A movie Run as select click edit A staff user Movies can Pass
_7 can be applicat movie button should be be deleted.
removed ion and able to
filled remove a
out movie from
informat the system
ion click
edit
button
6 FR5 TCI A Show Run as Enter A A Show Pass
_10 Time can applicat the staff/admin Time can
be added. ion details user should be added to
and be able to the
click add database.
submit information
about a
show time
of a movie
to the
system.
7 FR6 TCI A Show Run as Select click edit A staff user A Show Pass
_13 Time can applicat show button should be time can be
be updated ion time able to updated
filled update a
out show time
informat that exists
ion and on the
click system.
edit
8 FR6 TCI A band can Run as select click delete A staff user a band can Pass
_15 be applicat band button should be be deleted.
removed ion and able to
click remove a
delete band from
button the system.
9 FR5 TCI A city / Run as Enter City/town: A staff user A city/town Pass
_18 town can applicat the Bristol should be can be
be added. ion details able to add added.
and information
click about a
submit town or a
city into
the system.
8 Roll No:193
M.C.A.-Semester V
10 FR5 TCI When a Run as click City/town: If a staff all required Pass
_19 city / town applicat submit user tries to fields must
is added ion add a city / be filled in
all require town and before the
fields have leaves a data is
been filled required added to
in field blank the
they are database.
returned to
the concert
form and
informed
of the error.
11 FR5 TCI A city / Run as Fill out City/town: If a staff a town or Pass
_20 town applicat city/tow Bristol user tries to city cannot
cannot be ion n name add a city be added
added and with the twice.
twice click same name
submit as another
city they
are
returned to
the concert
form and
informed
of the error.
12 FR6, TCI A theater Run as add Movie :The If a staff A movie Pass
_24 cannot applicat movies Lost World user tries to cannot be
have two ion on same add a added if
movies time Show Time: concert for there is
booked on 3.00 p.m.- a movie already a
the same 5.30p.m. when one booking for
time. is already that movie
booked for on that
that time time.
they are
returned to
the Show
time form
and
informed
of the error.
13 FR5, TCI The Run as a staff click submit If a staff if the Pass
FR6 _26 concert applicat user button user tries to release date
date ion tries to add a is after the
9 Roll No:193
M.C.A.-Semester V
10 Roll No:193
M.C.A.-Semester V
Number
0123987456,
Start Date:
07/2003,Expi
ry Date:
10/2008,Secu
rity Code
951
15 FR2 TCI a client is Run as filled click login The client Users are Pass
_34 not able to applicat out user button should not able to
sign up ion name be able to change
without and sign up in their
the passwor the site if address
password d and the both details
in the click passwords once they
password login do not have
and re- button match. logged into
enter the site.
password
fields
matching.
16 FR9 TCI That a Run as filled click edit A client Pass
_35 client user applicat out button should be
can edit ion address able to edit
their info and their
address click address
details edit details
once they button once they
have have
signed in logged into
the
website.
17 FR9 TCI That a Run as filled click edit A client Users are Pass
_36 client user applicat out button should be able to
can edit ion credit able to edit change
their credit cart their credit their credit
card details card details card details
details and once they once they
once they click have have
have edit logged into logged into
signed in. button the the site.
website.
18 FR9 TCI That a Run as click click change A client Users are Pass
_37 client user applicat change password should be able to
can change ion passwor button able to edit change
11 Roll No:193
M.C.A.-Semester V
Practical No. 4
Program:
12 Roll No:193
M.C.A.-Semester V
#include<iostream.h>
#include<conio.h>
void main(){
clrscr();
int amount;
cout<<"\nEnter affordable amount for a room:";
cin>>amount;
if(amount <= 2000)
cout<<"\nRegular";
else if(amount < 4000)
cout<<"\nDelux";
else
cout<<"\nSuperDelux";
getch();}
13 Roll No:193
M.C.A.-Semester V
Test no. Pre requisite Input values Expected result Actual result Remarks
T1.1 Amount 3000 Regular Regular Pass
<=2000
T1.2 2001<= 4000 Delux Super Delux Fail
Amount
<=4000
T1.3 Amount <=0 -500 Error Regular Fail
T1.4 Amount 4002 Super Delux Super Delux Pass
>=4001
T1.5 Amount 1000 Error Regular Fail
>=2000
Program Number Line number Actual Deficiencies Required Statement
1 12 Delux room is else if(amount<=4000)
categorized as Super
Delux
2 NA Error message not if(amount <= 0 ||
displayed on invalid amount >1000 )
input
14 Roll No:193
M.C.A.-Semester V
15 Roll No:193
M.C.A.-Semester V
Practical No. 5
White box testing for Online Ticket booking system
16 Roll No:193
M.C.A.-Semester V
Program:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int count = 0;
char section = ; // Balcony or Upperstall
bool success;
int availableInBalcony = 50
int availableInUpperstall = 75
cout<<"\nEnter length:";
cin>> count;
cout<<"\nEnter section:";
cin>> section;
success = 0;
while(count <= 100&& count >=0)
{
if(section = Balcony)
{
if (count < = availableInBalcony )
{
availableInBalcony = availableInBalcony - count;
success = 1;
}
}
else
{
if (count < = availableInUpperstall)
{
availableInUpperstall = availableInUpperstall - count;
success = 1;
}
}
}
if (success = 1)
cout"\n Your ticket is booked successfully.;
17 Roll No:193
M.C.A.-Semester V
else
cout"\n Your ticket can not be booked.;
getch();
}
Test Cases:
Test Case Input Value Expected Output Actual Output Remark
Number
Count Section
1 2 B 48 48 Pass
2 5 U 70 70 Pass
3 5 B 43 43 Pass
4 6 U 64 64 Pass
7 10 B 33 33 Pass
Section Notation:
B=Available Balcony
18 Roll No:193
M.C.A.-Semester V
Branch/Loop Possible
Test Cases
values
1 2 3 4 5 6 7 8 9 10
Count<=100 T * * * * * *
F * * * *
Count<=B T * * * * *
F *
Count<=U T * *
F * *
Program:-
#include<iostream.h>
#include<conio.h>
void main()
19 Roll No:193
M.C.A.-Semester V
{
clrscr();
int charges=0;
int units=0;
int dis=0;
cout<<"\n Enter numbar of tickets :";
cin>>units;
if(units>=25)
{
dis=(500*units)/100;
charges=(units*20)-dis;
}
else
if(units>=10 && units<25)
{
dis=(200*units)/100;
charges=(units*20)-dis;
}
else
if(units>0 && units<10)
charges=units*20;
else
cout<<"\n Number of tickets entered is INVALID";
cout<<"\n Amount of bill=Rs."<<charges;
getch();
}
IF (units>=25) d
20 Roll No:193
ELSE
b
THE
c g
f
ENDIF k
j
ENDIF
l ENDIF m
v(G) =e n + 2
Where,
21 Roll No:193
M.C.A.-Semester V
Here,
e=14
n=12
And hence
v(G) = 14 12 + 2
=4
Path 1: a-d-g-i-k-l-m-n
Path 2: a-d-g-h-j-l-m-n
Path 3: a-d-e-f-m-n
Path 4: a-b-c-n
Number
22 Roll No:193
M.C.A.-Semester V
e) Test Matrix:
1 2 3 4 5 6 7 8 9 10
a,d,g,i,l,m,n X X X
a,d,g,h,i,l,m,n X
a,d,e,f,m,n X X X
a,b,c,n X X X
Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int yrs,grade,hrs,bonus; //2
printf("Enter the no of years worked : "); //3
23 Roll No:193
M.C.A.-Semester V
Conditional Coverage:
Yrs > 1 Grade > 3 Hrs > 180 Input value Possible Lines
(yrs,grd,hrs) outcome executed
(bonus)
F F F 1,1,160 0% 1-9, 11, 13,15
Practical No. 6
SOURCE CODE:
Exercise:
25 Roll No:193
M.C.A.-Semester V
1. Open paint application. Run WinRunner. Open new script. Start recording in context sensitive
recording mode. Draw anything using pencil tool in paint. Stop recording. Open new file in
paint and replay script from starting. Observe result and write detailed analysis.
Test Script:
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 1);
button_press ("start");
# BaseBar
set_window ("BaseBar", 11);
toolbar_select_item ("ToolbarWindow32_1", "Programs;Accessories;Paint");
# untitled - Paint
set_window ("untitled - Paint", 11);
obj_mouse_drag ("Afx:1000000:8", 10, 82, 136, 100, LEFT);
obj_mouse_click ("Afx:1000000:8", 126, 77, LEFT);
obj_mouse_drag ("Afx:1000000:8", 137, 108, 164, 114, LEFT);
win_close ("untitled - Paint");
# Paint
set_window ("Paint", 5);
button_press ("No");
26 Roll No:193
M.C.A.-Semester V
27 Roll No:193
M.C.A.-Semester V
2. Open paint application. Run WinRunner. Open new script. Start recording in analog recording
mode. Draw anything using pencil tool in paint. Stop recording. Open new file in paint and
replay script from starting. Observe result and write detailed analysis. What is difference in result of
Question 1 and Question 2?
Test Script file
# Analog Recording
move_locator_track (1);
move_locator_track (2);
mtype ("<T1547><kLeft>-<T63><kLeft>+");
move_locator_track (3);
move_locator_track (4);
mtype ("<T1093><kLeft>-<T63><kLeft>+");
move_locator_track (5);
mtype ("<T157><kLeft>-");
move_locator_track (6);
move_locator_track (7);
move_locator_track (8);
move_locator_track (9);
move_locator_track (10);
move_locator_track (11);
move_locator_track (12);
mtype ("<kLeft>+");
move_locator_track (13);
mtype ("<T109><kLeft>-<T250><kLeft>+");
move_locator_track (14);
mtype ("<kLeft>-");
move_locator_track (15);
move_locator_track (16);
mtype ("<T125><kLeft>+");
move_locator_track (17);
move_locator_track (18);
mtype ("<T313><kLeft>-<T47><kLeft>+");
move_locator_track (19);
move_locator_track (20);
mtype ("<T1141><kLeft>-");
mtype ("<T78><kLeft>+");
28 Roll No:193
M.C.A.-Semester V
3. Insert code after entering agent name and before entering password to wait window for 20 seconds.
Test Script File
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 0);
button_press ("start");
# BaseBar
set_window ("BaseBar", 4);
toolbar_select_item ("ToolbarWindow32_1", "Programs;WinRunner;Sample Applications;Flight
1A");
# Login
set_window ("Login", 1);
edit_set ("Agent Name:", "Shrenik");
obj_type ("Agent Name:","<kTab>");
wait(20)
password_edit_set("Password:", "kzptnyoslzjsaz");
button_press ("OK");
# Flight Reservation
29 Roll No:193
M.C.A.-Semester V
SOURCE CODE:
Exercise:
1. Open new script in WinRunner. Start recording in context sensitive mode. Start Flight 1A
application. Insert GUI checkpoint to check enabled property of Insert order button initially.
(Button is disabled). Type details of new order and again insert new GUI checkpoint for same
button for enabled property. (Button is enabled). Save test script. Close application Flight 1A.
Reruns saved script and analyze test result.
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 2);
button_press ("start");
# BaseBar
set_window ("BaseBar", 7);
toolbar_select_item ("ToolbarWindow32_1", "Programs;WinRunner;Sample Applications;Flight
1A");
# Login
set_window ("Login", 1);
edit_set ("Agent Name:", "Shrenik");
obj_type ("Agent Name:","<kTab>");
password_edit_set("Password:", "kzptnyoslzjsaz");
button_press ("OK");
# Flight Reservation
set_window("Flight Reservation", 14);
button_check_info("Insert Order","enabled",0);
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 3);
toolbar_button_press ("ToolbarWindow32_0", "Flight Reservation"); # Button Number 3;
# Flight Reservation
set_window ("Flight Reservation", 1);
obj_type ("MSMaskWndClass","101010");
30 Roll No:193
M.C.A.-Semester V
# Flights Table
set_window ("Flights Table", 0);
list_activate_item ("Flight", "20257 DEN 12:12 AM LON 07:23 PM AA $112.20"); #
Item Number 0;
# Flight Reservation
set_window ("Flight Reservation", 7);
edit_set ("Name:", "Shrenik");
button_check_info("Insert Order","enabled",1);
2. Open application Flight 1A and observe operation of searching order. Click File->Open Order.
Verify that order can be searched by either order number or by date or by customer name or by
combination of date and customer name.
31 Roll No:193
M.C.A.-Semester V
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 1);
button_press ("start");
# BaseBar
set_window ("BaseBar", 5);
toolbar_select_item ("ToolbarWindow32_1", "Programs;WinRunner;Sample Applications;Flight
1A");
# Login
set_window ("Login", 2);
edit_set ("Agent Name:", "Shrenik");
obj_type ("Agent Name:","<kTab>");
password_edit_set("Password:", "kzptnyoslzjsaz");
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 17);
menu_select_item ("File;Open Order...");
# Open Order
set_window ("Open Order", 16);
button_set ("Order No.", ON);
button_check_info("Order No.","enabled",1);
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 4);
toolbar_button_press ("ToolbarWindow32_0", "Flight Reservation"); # Button Number 3;
# Open Order
set_window ("Open Order", 2);
edit_set ("Edit", "4");
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 8);
menu_select_item ("File;Open Order...");
32 Roll No:193
M.C.A.-Semester V
# Open Order
set_window ("Open Order", 5);
button_set ("Flight Date", ON);
button_check_info("Flight Date","enabled",1);
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 2);
toolbar_button_press ("ToolbarWindow32_0", "Flight Reservation"); # Button Number 3;
# Open Order
set_window ("Open Order", 1);
obj_type ("MSMaskWndClass","010101");
button_press ("OK");
# Flight Reservations
set_window ("Flight Reservations", 1);
button_press ("OK");
# Open Order
set_window ("Open Order", 8);
button_press ("OK");
# Flight Reservations
set_window ("Flight Reservations", 0);
button_press ("OK");
# Open Order
set_window ("Open Order", 4);
button_set ("Customer Name", ON);
button_check_info("Customer Name","enabled",1);
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 1);
toolbar_button_press ("ToolbarWindow32_0", "Flight Reservation"); # Button Number 3;
# Open Order
set_window ("Open Order", 1);
edit_set ("Edit_1", "Shrenik");
button_press ("OK");
# Flight Reservations
33 Roll No:193
M.C.A.-Semester V
# Open Order
set_window ("Open Order", 1);
button_press ("Cancel");
# Flight Reservation
win_close ("Flight Reservation");
3. Open application Flight 1B and observe operation of searching order. Click File->Open Order.
Check the operation of searching a particular operation. What are defects in searching system?
Test Script File
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 1);
button_press ("start");
34 Roll No:193
M.C.A.-Semester V
# BaseBar
set_window ("BaseBar", 5);
toolbar_select_item ("ToolbarWindow32_1", "Programs;WinRunner;Sample Applications;Flight
1A");
# Login
set_window ("Login", 2);
edit_set ("Agent Name:", "Shrenik");
obj_type ("Agent Name:","<kTab>");
password_edit_set("Password:", "kzptnyoslzjsaz");
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 17);
menu_select_item ("File;Open Order...");
# Open Order
set_window ("Open Order", 16);
button_set ("Order No.", ON);
button_check_info("Order No.","enabled",1);
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 4);
toolbar_button_press ("ToolbarWindow32_0", "Flight Reservation"); # Button Number 3;
# Open Order
set_window ("Open Order", 2);
edit_set ("Edit", "4");
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 8);
menu_select_item ("File;Open Order...");
# Open Order
set_window ("Open Order", 5);
button_set ("Flight Date", ON);
button_check_info("Flight Date","enabled",1);
# Shell_TrayWnd
35 Roll No:193
M.C.A.-Semester V
# Open Order
set_window ("Open Order", 1);
obj_type ("MSMaskWndClass","010101");
button_press ("OK");
# Flight Reservations
set_window ("Flight Reservations", 1);
button_press ("OK");
# Open Order
set_window ("Open Order", 8);
button_press ("OK");
# Flight Reservations
set_window ("Flight Reservations", 0);
button_press ("OK");
# Open Order
set_window ("Open Order", 4);
button_set ("Customer Name", ON);
button_check_info("Customer Name","enabled",1);
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 1);
toolbar_button_press ("ToolbarWindow32_0", "Flight Reservation"); # Button Number 3;
# Open Order
set_window ("Open Order", 1);
edit_set ("Edit_1", "Shrenik");
button_press ("OK");
# Flight Reservations
set_window ("Flight Reservations", 0);
button_press ("OK");
# Open Order
36 Roll No:193
M.C.A.-Semester V
# Flight Reservation
win_close ("Flight Reservation");
4. Open new test script file in WinRunner. Open Flight 1A application, login it. Start recording in
context sensitive mode. Go to file->open order of Filght 1A application. Insert GUI checkpoints
for order No. check box, and insert any order number and then insert GUI checkpoint for
Customer Name checkbox. Save test script with proper name. Close Flight 1A application.
Login into it. Rerun saved script for this application and observe test result.
37 Roll No:193
M.C.A.-Semester V
Test Script:
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 0);
button_press ("start");
# BaseBar
set_window ("BaseBar", 3);
toolbar_select_item ("ToolbarWindow32_1", "Programs;WinRunner;Sample Applications;Flight
1A");
# Login
set_window ("Login", 0);
edit_set ("Agent Name:", "Shrenik");
obj_type ("Agent Name:","<kTab>");
password_edit_set("Password:", "kzptnyoslzjsaz");
obj_type ("Password:","<kReturn>");
# Flight Reservation
set_window ("Flight Reservation", 11);
menu_select_item ("File;Open Order...");
# Open Order
set_window ("Open Order", 4);
button_set ("Order No.", ON);
button_check_info("Order No.","enabled",1);
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 0);
toolbar_button_press ("ToolbarWindow32_0", "Flight Reservation"); # Button Number 3;
# Open Order
set_window ("Open Order", 3);
edit_set ("Edit", "4");
button_check_info("Customer Name","enabled",0);
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 2);
toolbar_button_press ("ToolbarWindow32_0", "Flight Reservation"); # Button Number 3;
38 Roll No:193
M.C.A.-Semester V
# Open Order
set_window ("Open Order", 1);
button_press ("OK");
# Flight Reservation
win_close ("Flight Reservation");
39 Roll No:193
M.C.A.-Semester V
5. Open Flight 1B application and login into it. Rerun saved test script for this application. Check
test result. What are differences in test result compared to result in previous question?
40 Roll No:193
M.C.A.-Semester V
SOURCE CODE:
Exercise:
Follow following step to apply bitmap checkpoint to Agent signature in Fax order form of flight
application 1A. Observe results by rerunning saved test script.
Steps:
Test Script
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 0);
button_press ("start");
# BaseBar
set_window ("BaseBar", 3);
toolbar_select_item ("ToolbarWindow32_1", "Programs;WinRunner;Sample Applications;Flight
1A");
# Login
set_window ("Login", 1);
edit_set ("Agent Name:", "Shrenik");
obj_type ("Agent Name:","<kTab>");
password_edit_set("Password:", "kzptnyoslzjsaz");
button_press ("OK");
41 Roll No:193
M.C.A.-Semester V
# Flight Reservation
set_window ("Flight Reservation", 10);
menu_select_item ("File;Open Order...");
# Open Order
set_window ("Open Order", 3);
button_set ("Order No.", ON);
edit_set ("Edit", "4");
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 2);
menu_select_item ("File;Fax Order...");
# Analog Recording
move_locator_track (1);
move_locator_track (2);
move_locator_track (3);
mtype ("<T47><kLeft>-");
move_locator_track (4);
mtype ("<T31><kLeft>+");
move_locator_track (5);
move_locator_track (6);
mtype ("<T282><kLeft>-");
move_locator_track (7);
move_locator_track (8);
move_locator_track (9);
move_locator_track (10);
move_locator_track (11);
mtype ("<kLeft>+");
move_locator_track (12);
mtype ("<T172><kLeft>-<T156><kLeft>+");
move_locator_track (13);
mtype ("<T187><kLeft>-");
move_locator_track (14);
mtype ("<T390><kLeft>+");
42 Roll No:193
M.C.A.-Semester V
move_locator_track (15);
mtype ("<T62><kLeft>-");
move_locator_track (16);
move_locator_track (17);
mtype ("<T16><kLeft>+");
move_locator_track (18);
move_locator_track (19);
mtype ("<T1859><kLeft>-<T141><kLeft>+");
move_locator_track (20);
mtype ("<T250><kLeft>-<T110><kLeft>+");
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 0);
toolbar_button_press ("ToolbarWindow32_0", "Flight Reservation"); # Button Number 3;
# Flight Reservation
win_close ("Flight Reservation");
43 Roll No:193
M.C.A.-Semester V
44 Roll No:193
M.C.A.-Semester V
45 Roll No:193
M.C.A.-Semester V
SOURCE CODE:
Exercise:
1. Start WinRunner and open new test script.Start recording in context sensitive mode. Start Flight 1A
application. Insert one record in application Flight 1A. Apply database checkpoint (default check) to
orders table. Observe result. Save test script. Go to actual database (Program files->mercury
interactive->winnrunner->samples->flight->app->flight32.mdb) and open orders table. Delete record
with order number 10. Rerun saved script to observe mismatch.
Test Script
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 1);
button_press ("start");
# BaseBar
set_window ("BaseBar", 3);
toolbar_select_item ("ToolbarWindow32_1", "Programs;WinRunner;Sample Applications;Flight
1A");
# Login
set_window ("Login", 3);
edit_set ("Agent Name:", "shrenik");
obj_type ("Agent Name:","<kTab>");
password_edit_set("Password:", "kzptnyoslzjsaz");
obj_type ("Password:","<kReturn>");
# Flight Reservation
set_window ("Flight Reservation", 6);
obj_type ("MSMaskWndClass","101011");
list_select_item ("Fly From:", "Denver"); # Item Number 0;
list_select_item ("Fly To:", "London"); # Item Number 1;
obj_mouse_click ("FLIGHT", 35, 37, LEFT);
# Flights Table
set_window ("Flights Table", 0);
list_activate_item ("Flight", "20264 DEN 12:12 AM LON 07:23 PM AA $112.20"); #
46 Roll No:193
M.C.A.-Semester V
Item Number 1;
# Flight Reservation
set_window ("Flight Reservation", 1);
edit_set ("Name:", "Shrenik");
button_press ("Insert Order");
#
# Original SQL: SELECT Orders.Order_Number FROM Orders Orders
#
db_check("list1.cdl", "dbvf1");
47 Roll No:193
M.C.A.-Semester V
48 Roll No:193
M.C.A.-Semester V
2. Start WinRunner and open new test script. Start recording in context sensitive mode. Start Flight 1A
application. Insert one record in application Flight 1A. Apply database checkpoint (custom check) to
orders table. Select RowCount, ColumnCount and content options while executing query. Check
test result for RowCount, Column Count and content of the table. Observe result. Save test script.
Test Script:
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 0);
button_press ("start");
# BaseBar
set_window ("BaseBar", 3);
toolbar_select_item ("ToolbarWindow32_1", "Programs;WinRunner;Sample Applications;Flight
1A");
49 Roll No:193
M.C.A.-Semester V
# Login
set_window ("Login", 0);
edit_set ("Agent Name:", "Shrenik");
obj_type ("Agent Name:","<kTab>");
password_edit_set("Password:", "kzptnyoslzjsaz");
obj_type ("Password:","<kTab>");
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 5);
obj_type ("MSMaskWndClass","101010");
list_select_item ("Fly From:", "Denver"); # Item Number 0;
list_select_item ("Fly To:", "Los Angeles"); # Item Number 2;
obj_mouse_click ("FLIGHT", 55, 29, LEFT);
# Flights Table
set_window ("Flights Table", 0);
list_activate_item ("Flight", "3897 DEN 06:33 PM LAX 07:31 PM SW $126.40"); #
Item Number 1;
# Flight Reservation
set_window ("Flight Reservation", 1);
edit_set ("Name:", "Shrenik");
button_press ("Insert Order");
#
# Original SQL: select * from orders
#
db_check("list1.cdl", "dbvf1");
50 Roll No:193
M.C.A.-Semester V
51 Roll No:193
M.C.A.-Semester V
52 Roll No:193
M.C.A.-Semester V
53 Roll No:193
M.C.A.-Semester V
3. Start WinRunner and open new test script. Start recording in context sensitive mode. Start Flight 1A
application. Insert one record in application Flight 1A. Apply database checkpoint (Runtime check)
to orders table. Execute query: select orders.customer_name from orders. Check test result for
selected content of the table. Observe result. Save test script.
Test Script:
# Shell_TrayWnd
set_window ("Shell_TrayWnd", 0);
button_press ("start");
# BaseBar
set_window ("BaseBar", 3);
toolbar_select_item ("ToolbarWindow32_1", "Programs;WinRunner;Sample Applications;Flight
1A");
# Login
set_window ("Login", 1);
edit_set ("Agent Name:", "Shrenik");
obj_type ("Agent Name:","<kTab>");
password_edit_set("Password:", "kzptnyoslzjsaz");
button_press ("OK");
# Flight Reservation
set_window ("Flight Reservation", 8);
obj_type ("MSMaskWndClass","101010");
list_select_item ("Fly From:", "Denver"); # Item Number 0;
list_select_item ("Fly To:", "London"); # Item Number 1;
obj_mouse_click ("FLIGHT", 57, 28, LEFT);
# Flights Table
set_window ("Flights Table", 0);
list_activate_item ("Flight", "20257 DEN 12:12 AM LON 07:23 PM AA $112.20"); #
Item Number 0;
# Flight Reservation
set_window ("Flight Reservation", 1);
edit_set ("Name:", "Shrenik");
button_press ("Insert Order");
db_record_check("list1.cvr", DVR_ONE_OR_MORE_MATCH, record_num);
54 Roll No:193
M.C.A.-Semester V
55 Roll No:193
M.C.A.-Semester V
56 Roll No:193
M.C.A.-Semester V
SOURCE CODE:
Exercise:
1. Start WinRunner. Start new test. Start recording in context sensitive mode. Open Flight 1A
application and log in. Open Help->About from this application menu. Insert text checkpoint
(Create->Get Text->From Object/Window) and select text Version 1.0 from opened application
window.
Insert following code to verify same text in rerun after obj_get_text() statement.
report_message(Text is matched);
else
57 Roll No:193