You are on page 1of 19

Here is a small experiment with windows based flight reservation sample application.

*************************************
Dim StartTime, EndTime, StartTime1, EndTime1

SystemUtil.Run C:\Program Files\Mercury Interactive\QuickTest


Professional\samples\flight\app\flight4a.exe,",C:\Program Files\Mercury
Interactive\QuickTest Professional\samples\flight\app\,open

With Dialog(Login)
.WinEdit(Agent Name:).Set mercury
.WinEdit(Agent Name:).Type micTab
.WinEdit(Password:).SetSecure 4864ede3f3f8f30757cf694e3e100d29bf1ea9b9
.WinEdit(Password:).Type micReturn
End With

StartTime = Timer
With Window(Flight Reservation)
For i=1 to 1000
.WinEdit(Name:).Set Ankur
Next
End With
EndTime = Timer
msgbox EndTime StartTime

result: 41.71875

Window(Flight Reservation).Close

SystemUtil.Run C:\Program Files\Mercury Interactive\QuickTest


Professional\samples\flight\app\flight4a.exe,",C:\Program Files\Mercury
Interactive\QuickTest Professional\samples\flight\app\,open

With Dialog(Login)
.WinEdit(Agent Name:).Set mercury
.WinEdit(Agent Name:).Type micTab
.WinEdit(Password:).SetSecure 4864ede3f3f8f30757cf694e3e100d29bf1ea9b9
.WinEdit(Password:).Type micReturn
End With

StartTime1 = Timer
For i=1 to 1000
Window(Flight Reservation).WinEdit(Name:).Set Ankur
Next
EndTime1 = Timer
msgbox EndTime1 StartTime1

result1: 45.85938
******************************

This experiment was carried out on my machine which has 2GB RAM. With 1000
iterations the diff is > 4 secs. I think the effect (performance degradation) should be much
more pronounced on larger tests and if it is carried out on machines having configuration
just on threshold (512MB- one which is min RAM recommended by HP).

In case of With statement, the ref to the function Window() is getting stored at one
place(RAM) and it gets referenced (w/o going to OR on each iteration) while without
With the function Window() and WinEdit() both are called on each iteration and probably
that is responsible for the delay.

Please dont get annoyed for my excessive usage of the term RAM I have been
reading a lot on performance testing, memory leakage etc these days.

#3 Will Roden on 06.27.08 at 10:31

Now I see what you mean. I tried the same code on my laptop, and the performance
difference was more pronounced. 43.26563s and 68.92188s respectively.

Then I tried it the way that I would normally handle this situation:

Set oWinEdit = Window(Flight Reservation).WinEdit(Name:)


For i=1 to 1000
oWinEdit.Set Ankur
Next

This took only 15.48438s, but I immediately realized it wasnt a valid comparison. It was
faster because it set an object for the WinEdit and didnt have to find it each time. So I
changed it to this:

Set oWindow = Window(Flight Reservation)


For i=1 to 1000
oWindow.WinEdit(Name:).Set Ankur
Next

This took 41.84375s. A slight improvement over the with statement, but close enough to
not make a big difference.

Here is a small experiment with windows based flight reservation sample application.
*************************************
Dim StartTime, EndTime, StartTime1, EndTime1
SystemUtil.Run C:\Program Files\Mercury Interactive\QuickTest
Professional\samples\flight\app\flight4a.exe,",C:\Program Files\Mercury
Interactive\QuickTest Professional\samples\flight\app\,open

With Dialog(Login)
.WinEdit(Agent Name:).Set mercury
.WinEdit(Agent Name:).Type micTab
.WinEdit(Password:).SetSecure 4864ede3f3f8f30757cf694e3e100d29bf1ea9b9
.WinEdit(Password:).Type micReturn
End With

StartTime = Timer
With Window(Flight Reservation)
For i=1 to 1000
.WinEdit(Name:).Set Ankur
Next
End With
EndTime = Timer
msgbox EndTime StartTime

result: 41.71875

Window(Flight Reservation).Close

SystemUtil.Run C:\Program Files\Mercury Interactive\QuickTest


Professional\samples\flight\app\flight4a.exe,",C:\Program Files\Mercury
Interactive\QuickTest Professional\samples\flight\app\,open

With Dialog(Login)
.WinEdit(Agent Name:).Set mercury
.WinEdit(Agent Name:).Type micTab
.WinEdit(Password:).SetSecure 4864ede3f3f8f30757cf694e3e100d29bf1ea9b9
.WinEdit(Password:).Type micReturn
End With

StartTime1 = Timer
For i=1 to 1000
Window(Flight Reservation).WinEdit(Name:).Set Ankur
Next
EndTime1 = Timer

msgbox EndTime1 StartTime1

result1: 45.85938
******************************
This experiment was carried out on my machine which has 2GB RAM. With 1000
iterations the diff is > 4 secs. I think the effect (performance degradation) should be much
more pronounced on larger tests and if it is carried out on machines having configuration
just on threshold (512MB- one which is min RAM recommended by HP).

In case of With statement, the ref to the function Window() is getting stored at one
place(RAM) and it gets referenced (w/o going to OR on each iteration) while without
With the function Window() and WinEdit() both are called on each iteration and probably
that is responsible for the delay.

Please dont get annoyed for my excessive usage of the term RAM I have been
reading a lot on performance testing, memory leakage etc these days.

#3 Will Roden on 06.27.08 at 10:31

Now I see what you mean. I tried the same code on my laptop, and the performance
difference was more pronounced. 43.26563s and 68.92188s respectively.

Then I tried it the way that I would normally handle this situation:

Set oWinEdit = Window(Flight Reservation).WinEdit(Name:)


For i=1 to 1000
oWinEdit.Set Ankur
Next

This took only 15.48438s, but I immediately realized it wasnt a valid comparison. It was
faster because it set an object for the WinEdit and didnt have to find it each time. So I
changed it to this:

Set oWindow = Window(Flight Reservation)


For i=1 to 1000
oWindow.WinEdit(Name:).Set Ankur
Next

This took 41.84375s. A slight improvement over the with statement, but close enough to not
make a big difference. SPMS TEST SCRIPTS SAMPLE

The following sample is a subset of the test scripts contained within the sample document. The
total volume of actual test scripts is lengthy and the subset illustrates what the test scripts look
like.

Please Note
All Test Results will be verified using System Inquiry functions and Tickler Lists where possible.
This will allow for testing of these functions without explicitly specifying that they will be done.
Set the System Date to March 1, 2005.

Functional Package: 1.0 Table Maintenance

Test Script: 1.1 Table Maintenance

Procedure & Data Expected Results Status

1. Add Offices;640, 511, 121, 406, 646, 515, Offices are added to the Table with a Status of
527, 999, 318 ACTIVE (1).

2. Change Offices Offices are updated on the Table.

3. Delete Offices Offices are updated on the Table with a Status of


INACTIVE (0).

4. ScreenHelp.: Screen Level Help appears and is validated.

Test Script: 1.2 Event Code Table Maintenance

Procedure & Data Expected Results Status

1. Add Event Codes; 0100, 0105, 0110, 0120, Event Codes are added to the Event Code Table
0125, 0130, 0140, 0150, 0160, 0165, 0170, with a Status of ACTIVE (1).
0180, 0190, 0200, 0210, 0220, 0230, 0240,
0250, 0260, 0270, 0280, 1000, 1010, 1020:

2. Change Event Codes Event Codes are updated on the Event Code Table.

3. Delete Event Codes Event Codes are updated on the Event Code Table
with a Status of INACTIVE (0).

4. ScreenHelp.: Screen Level Help appears and is validated.


Functional Package: 1.0 Table Maintenance

Test Script: 1.1 Table Maintenance

Procedure & Data Expected Results Status

1. Add Offices;640, 511, 121, 406, 646, 515, Offices are added to the Table with a Status of
527, 999, 318 ACTIVE (1).

2. Change Offices Offices are updated on the Table.

3. Delete Offices Offices are updated on the Table with a Status of


INACTIVE (0).

4. ScreenHelp.: Screen Level Help appears and is validated.

Test Script: 1.2 Event Code Table Maintenance

Procedure & Data Expected Results Status

Test Script: 1.3 Global Message Maintenance

Procedure & Data Expected Results Status

1. Add Global Message A Global Message is added to the Global Message


Table

2. Add Global Message Invalid Action: Only one global message can exist
on this file.

3. Change Global Message Global Message is updated on the Global Message


Table
Functional Package: 1.0 Table Maintenance

Test Script: 1.1 Table Maintenance

Procedure & Data Expected Results Status

1. Add Offices;640, 511, 121, 406, 646, 515, Offices are added to the Table with a Status of
527, 999, 318 ACTIVE (1).

2. Change Offices Offices are updated on the Table.

3. Delete Offices Offices are updated on the Table with a Status of


INACTIVE (0).

4. ScreenHelp.: Screen Level Help appears and is validated.

Test Script: 1.2 Event Code Table Maintenance

Procedure & Data Expected Results Status

4. Delete Global Message Global Message is deleted from the database.

5. ScreenHelp.: Screen Level Help appears and is validated.

Test Script: 1.4 Province Table Maintenance

Procedure & Data Expected Results Status

1. Add Provinces Provinces are added to the Province Table.

2. Change Provinces: Provinces are updated on the Province Table.


Functional Package: 1.0 Table Maintenance

Test Script: 1.1 Table Maintenance

Procedure & Data Expected Results Status

1. Add Offices;640, 511, 121, 406, 646, 515, Offices are added to the Table with a Status of
527, 999, 318 ACTIVE (1).

2. Change Offices Offices are updated on the Table.

3. Delete Offices Offices are updated on the Table with a Status of


INACTIVE (0).

4. ScreenHelp.: Screen Level Help appears and is validated.

Test Script: 1.2 Event Code Table Maintenance

Procedure & Data Expected Results Status

3. Delete Provinces: Province is deleted from the database.

4. ScreenHelp.: Screen Level Help appears and is validated.


Test Script: 1.5 Provincial Minimum Wage Table Maintenance

Procedure & Data Expected Results Status

1. Add Provincial Minimum Wage Minimum Wages are added to the Provincial
Minimum Wage Table

NW Cannot be entered because province does


not exist.

2. Change Minimum Wage: Minimum Wages are updated on the Provincial


Minimum Wage Table.

3. Delete Minimum Wage: Minimum Wage is deleted from the database.

4. ScreenHelp.: Screen Level Help appears and is validated.

Test Script: 1.6 CPP Rate Table Maintenance

Procedure & Data Expected Results Status

1. Add CPP Rate CPP Rates are added to the CPP Rate Table.

2. Change CPP Rate: CPP Rate is updated on the CPP Rate Table.

3. Delete CPP Rate: CPP Rate is deleted from the database.

4. ScreenHelp.: Screen Level Help appears and is validated.

Test Script: 1.7 Economic Region Code Table Maintenance

Procedure & Data Expected Results Status


Test Script: 1.5 Provincial Minimum Wage Table Maintenance

Procedure & Data Expected Results Status

1. Add Provincial Minimum Wage Minimum Wages are added to the Provincial
Minimum Wage Table

NW Cannot be entered because province does


not exist.

2. Change Minimum Wage: Minimum Wages are updated on the Provincial


Minimum Wage Table.

3. Delete Minimum Wage: Minimum Wage is deleted from the database.

4. ScreenHelp.: Screen Level Help appears and is validated.

1. Add Economic Region Code Economic Region Codes are added to the
Economic Region Code Table.

2. Change Economic Region Code: Economic Region Code is updated on the


Economic Region Code Table.

3. Delete Economic Region Code: Economic Region Code is deleted from the
database.

4. ScreenHelp.: Screen Level Help appears and is validated.

Set the System Date to March 6, 2005.


Functional Package: 2.0 Cohort Load

Test Script: 2.1 Cohort Load Processes

Procedure & Data Expected Results Status

1. Sign on to the System as a Supervisor and 1. Cohort Load completes successfully.


Run the Cohort Load Procedure for Cohort
Load # 1. ID #s are correct.

Participants are created in the Participant


Table with a status of Pending.

The Clock Start Date is March 9, 2005.

The Supplement Expiry Date is March 9,


2007.

If the Participant is a Repeater the Take-up


Expiry is June 1, 2005

If the Participant is Displaced the Take-up


Expiry is September 7 , 2005.

The appropriate Notification Letter is


produced for each participant and contains
accurate information.

An event is created (0100 - Notification


Letter Sent) for each Participant along with a
follow-up event (0105). The Notification
Letters are to be cross checked with the
Control Sheet produced.

An orientation list is produced for each Office


showing all outstanding orientations.

46400101, 64000103, 52700105,


51100107, 52700109, 12100111,
31800113, 64000115

Set the System Date to March 10, 2005.


Functional Package: 3.0 Participant Data

Test Script: 3.1 Print Initiation Forms

Procedure & Data Expected Results Status

1. Participants Requests Initiation Package:

Inquire on each Participant and select to Participants listed on the Name Search are
print the Initiation Forms; 46400101, correct.
64000103, 52700105, Carrot Patricia, Corn
Thomas K.
Data Displayed in Participant Inquiry is
accurate.

Employment Initiation Form, Program


Participation agreement, Instructions and
Initiation form are printed for the Participant.

Two events are created. (0160) Initiation


Forms Printed and (0165) Follow-up on
Initiation Forms.

Set the System Date to March 13, 2005

Functional Package: 2.0 Cohort Load

Test Script: 2.2 Cohort Load Processes

Procedure & Data Expected Results Status

1. Sign on to the System as a Supervisor and 1. Cohort Load completes successfully


Run the Cohort Load Procedure for Cohort
Load # 2. ID numbers are correct.

Participants are created in the Participant


Functional Package: 2.0 Cohort Load

Test Script: 2.2 Cohort Load Processes

Procedure & Data Expected Results Status

Table with a status of Pending.

The Clock Start Date is March 16, 2005.

The Supplement Expiry Date is March 16,


2007.

If the Participant is a Repeater the Take-up


Expiry is June 8, 2005.

If the Participant is Displaced the Take-up


Expiry is September 14 , 2005.

The appropriate Notification Letter is


produced for each participant and contains
accurate information.

An event is created (0100 - Notification


Letter Sent) for each Participant along with a
follow-up event (0105). The Notification
Letters are to be cross checked with the
Control Sheet produced..

An orientation list is produced for each Office


showing all outstanding orientations.

46400101, 64000103, 52700105,


51100107, 52700109, 12100111,
31800113, 64000115, 31800117,
51100119, 46400121, 64000123,
52700125, 51100127, 52700129,
12100131
Set the System Date to March 14, 2005.

Functional Package: 3.0 Participant Data

Test Script: 3.2 Print Initiation Forms

Procedure & Data Expected Results Status

1. Participants Requests Initiation Package:

Inquire on each Participant and select to Participants listed on the Name Search are
print the Initiation Forms; 12100111, correct.
31800113, Five Leslie C
Data Displayed in Participant Inquiry is
accurate.

Employment Initiation Form, Program


Participation agreement, Instructions and
Initiation form are printed for the Participant.

Two events are created. (0160) Initiation


Forms Printed and (0165) Follow-up on
Initiation Forms.

Set the System Date to March 15, 2005.


Functional Package: 3.0 Participant Data

Test Script: 3.3 Update Orientation Date

Procedure & Data Expected Results Status

Update Orientation Date on the following Orientation Date is updated on the Participant
participants to March 15, 2005: 46400101, records.
64000103, 52700105, 51100107, 52700109,
12100111, 31800113, 64000115

Set the System Date to March 20, 2005.

Functional Package: 2.0 Cohort Load

Test Script: 2.3 Cohort Load Processes

Procedure & Data Expected Results Status

1. Sign on to the System as a Supervisor and 1. Cohort Load completes successfully.


Run the Cohort Load Procedure for Cohort
Load # 3. ID numbers are correct.

Participants are created in the Participant


Table with a status of Pending.

The Clock Start Date is March 23, 2005.

The Supplement Expiry Date is March 23,


2007.

If the Participant is a Repeater the Take-up


Expiry is June 15, 2005.

If the Participant is Displaced the Take-up


Expiry is September 21, 2005.
Functional Package: 2.0 Cohort Load

Test Script: 2.3 Cohort Load Processes

Procedure & Data Expected Results Status

The appropriate Notification Letter is


produced for each participant and contains
accurate information.

An event is created (0100 - Notification


Letter Sent) for each Participant along with a
follow-up event (0105). The Notification
Letters are to be cross checked with the
Control Sheet produced..

An orientation list is produced for each Office


showing all outstanding orientations.

31800117, 51100119, 46400121,


64000123, 52700125, 51100127,
52700129, 12100131, 31800133,
64000135, 31800137, 64000139,
46400141, 64000143, 46400145,
51100147

Functional Package: 4.0 Employment Data Update / Inquiry

Test Script: 4.1 Employment Initiation (Overlaps Clock Start)

Procedure & Data Expected Results Status

1. Initiation Package is received from 1. Employment information is added to the


Participant 64000103. Pay Frequency is Employment Table.
Weekly, Job Start is March 6, 2005. Enter
the Employment information.

2. Initiation Package is received from


Functional Package: 4.0 Employment Data Update / Inquiry

Test Script: 4.1 Employment Initiation (Overlaps Clock Start)

Procedure & Data Expected Results Status

Participant 51100107. Pay Frequency is Bi-


Weekly, Job Start is March 6, 2005. Enter
the Employment Information 2. Employment information is added to the
Employment Table.
3. Sign on as a Supervisor and change the
Employment Statuses to Active. At this time,
the initial voucher is entered...

64000103 -Pay Period is March 3 to March


16, Hours Paid = 75 (Week 1 = 35, Week 2 =
40), Wages Earned = 525.00 and CPP = 3. Employment record is set to Active (Event
10.64. Employer Province = (NF) 0170 created), 6 months worth of vouchers are
printed and the Voucher Entry screen is
51100107 - Pay Period is March 3 to March invoked where the Voucher information is
16, Hours Paid = 75 (Week 1 = 35, Week 2 = added
40), Wages Earned = 525 and CPP = 10.64.
Employer Province = (N.B. 64000103 - (7/14 * 772.22) - (40/75 * 525) =
106.11 * 75%= 79.58

51100107 - (7/14 * 776.22 - (40/75 * 525) =


108.11 * 75% =81.08

Event 0180 is created for both of these


participants and the Participant Status is set to
Active.

Set the System Date to March 21, 2005.


Functional Package: 4.0 Employment Data Update / Inquiry

Test Script: 4.2 Employment Initiation (Overlaps Clock Start)

Procedure & Data Expected Results Status

1. Initiation Package is received from 1. Employment information is added to the


Participant 46400101. Pay Frequency is Employment Table.
Weekly, Job Start is March 6, 2005. Enter
the Employment information.

2. Initiation Package is received from


Participant 52700105. Pay Frequency is Bi-
Weekly, Job Start is March 6, 2005. Enter
the Employment Information 2. Employment information is added to the
Employment Table.
3. Initiation Package is received from
Participant 52700109. Pay Frequency is
Semi-Monthly, Job Start is March 6, 2005.
Enter the Employment Information.

4. Sign on as a Supervisor and change the 3. Employment information is added to the


Employment Statuses to Active. At this time, Employment Table.
the initial voucher is entered...

46400101 -Pay Period is March 5 to March


18, Hours Paid = 75 (Week 1 = 40, Week 2 =
35), Wages Earned = 450.00 and CPP = 8.62.
Employers Province = (PE)
4. Employment record is set to Active (Event
52700105 - Pay Period is March 5 to March 0170 created), and the Voucher Entry screen is
18, Hours Paid = 75 (Week 1 = 40, Week 2 = invoked where the Voucher information is
35), Wages Earned = 450.00 and CPP = 8.62. added
Employers Province = (PQ)
46400101 - (7/14 * 770.22) - (35/75 * 450) =
52700109 - Pay Period is March 1 to March 175.11 * 75% = 131.33
15, Hours Paid = 75 (Week 1 = 45, Week 2 =
25, Rem = 5), Wages Earned = 600 and CPP
= 12.37. Employers Province= (MA)
52700105 - (7/14 * 776.22) - (35/75 * 450) =
177.11 * 75% = 132.83

Event 0180 is created for both of these


participants and the Participant Status is set to
Active.
Functional Package: 4.0 Employment Data Update / Inquiry

Test Script: 4.2 Employment Initiation (Overlaps Clock Start)

Procedure & Data Expected Results Status

52700109 - No Supplement Paid, Participant


is not activated. This voucher is rejected.

Set the System Date to March 22, 2005.

Functional Package: 3.0 Participant Data

Test Script: 3.4 Update Orientation Date

Procedure & Data Expected Results Status

Update Orientation Date on the following Orientation Date is updated on the Participant
participants to March 22, 2005: 31800117, records.
51100119, 46400121, 64000123, 52700125,
51100127, 52700129, 12100131

You might also like