Vous êtes sur la page 1sur 41

1.

a) Test Conditions for vending machine:


1. First check whether the power supply works or not.
2. Check the system whether it is working properly.
3. Check whether the port is working properly.
4. Check the machine when inserting a bottle whether it is working properly.
5. Check the machine if it is giving alert to the user, if it is empty.
6. Check whether the correct quality is inserted based on the price.
7. Check the internet connection whether it is working properly for billing purpose.
8. Check whether the card reader is working properly and it is inserted in the right direction
or not.

b) Test Conditions for Ceiling Fan:


1. Check that the Ceiling Fan is exactly mounted in the Wall.
2. Check that the Blades are fitted in the Fan.
3. Check whether the fan is running while switching on.
4. Check whether the fan is stopped when switching it off.
5. Check that the air circulation up on the Regulator speed.
6. Check the Ceiling fan running at Voltage problem.
7. Check the Ceiling fan life by run certain hour per day.
8. Check the Ceiling fan sound after several hours of run

c) Test conditions for Bank Account to Account Money Transfer:


1. Check whether the username and password is correct or not.
2. Check whether you can access your account or not.
3. Check the account number, whether it is correctly entered or not.
4. Check the balance in your account to transfer to another account.
5. Check the minimum number of transactions is available or not.
6. Check the limit of the amount to transfer.
7. Check the transfer of amount, account to account to same branch or other branch.
8. After transaction check whether receiver can collect the amount correctly or not.
9. Check the message and balance of your account.

d) Test conditions for Gmail Registration:


1. Verify that all the specified fields are present on the registration page.

1
2. Verify that the required/ mandatory fields are marked with * symbol in the page.
3. Verify that for better user interface different components like radio buttons, check boxes,
combo boxes, lists and text areas etc are used.
4. Verify the page has both submit and cancel buttons at the end
5. After entering all the required fields verify by clicking on the submit button, whether the
data is submitted to the server or not.
6. After entering all the required fields verify by clicking on the cancel button will reset the
fields on the page or not.
7. Verify that whenever possible validation should take place at client side.
8. Verify that without filling the mandatory fields and clicking submit button will lead to
validation error or not.

e) Test conditions for Gmail Compose:


1. Check the compare box labels.

2. Check out whether on clicking compose mail take you to a page where you can enter the text.

3. Check whether it has to CC, BCC to enter email address.

4. Check whether to CC, BCC accepts valid email address if it does how address can be entered.

5. Check out if you can delete/edit, copy, past and format the text content.

6. Check whether you can send mail or cancel mail. You can go on with test case.

7. After entering all messages of text then you press send button.

8. Check whether it is correctly sending or not.

2
2. Gmail- Registration

Use Case: - Registration

Specification: - First name

Minimum = Maximum = 20 characters

First name =Combination of alphabets

No Numbers, No Special characters are allowed

Equivalence Class Partitioning:

Valid In_Valid
A-Z Numbers(0-9)
a-z Special characters
blank space
Boundary value Analysis:-

Minimum Maximum

4 20

Test Data Positive Negative


Enter Alphabets Enter Numbers
Enter Lowercase Enter Special
Enter Uppercase Characters
Enter Blank spaces

Specification:- Last name

Last name = Combination of alphabets

Minimum = 4, Maximum = 20 Characters

No Numeric’s any special characters are allowed

Equivalence Class partitioning:-

Valid In_Valid
A-Z Numbers(0-9)
a-z Special characters
blank space

Boundary Value analysis:-

Minimum Maximum

4 20

Test Data Positive Negative


Enter Alphabets Enter Numbers
Enter Uppercase Enter Special

3
Enter Lowercase Characters
Enter Blank spaces

Specification: - Mailbox

Minimum = 10

Maximum = 25 characters.

Mailid is the combination of alpha numeric’s of one uppercase, one special character and one
number and it doesn’t allow the bank spaces.

ECP:-

Valid In_Valid
A-Z
a-z Blank names
0-9
Special characters
BSV

Minimum Maximum

10 25

Test Data Positive Negative


Enter Alphabets
Enter Uppercase Enter blank spaces
Enter Lowercase
Enter special characters
Specification: Password

It is a combination of alphanumeric with the minimum of ‘1’ capital letter, minimum of the
special character minimum (8) and maximum (12) and no blank spaces are allowed.

Valid In_Valid
A-Z
a-z Blank Spaces
0-9
Special characters
BSV

Minimum Maximum

10 25

Test Data Positive Negative


Enter Alpha numeric’s
Enter Uppercase Enter blank spaces
Enter Lowercase
Enter special characters
Specification: - Conform Password

4
Enter the data as same as password and enter the same password what you enter in the above
password field.

Specification:- Data Of Birth

Minimum = maximum =6 characters

Date of birth is the combination of alpha numeric in the view of month will be allowed as their names. It
is in the form of DD/MM/YYYY.

It doesn’t allow special character except %

ECP:-

Valid In_Valid
0-9 Special Characters
A-Z Blank Spaces
a-z Blank Spaces
BSV

Minimum Maximum

9 9

Test Data Positive Negative


Enter DD/MM/YYYY Enter other than this format

5
Use Case: Compose

Specification: - To address

To address the combination of alphanumeric and also special characters.

Minimum = Maximum = 50 character

ECP:-

Valid In_Valid
A-Z
a-z Blank Spaces
0-9
Special
BSV

Minimum Maximum

10 25

Test Data Positive Negative


Enter Alpha numeric’s
Enter Uppercase Enter blank spaces
Enter Lowercase Enter the invalid address
Enter special characters
Specification:-/BCC

In CC/BCC is used to select the message is seen by all people of entered mail.

Valid In_Valid
A-Z
a-z Blank Spaces
0-9 Special characters

BSV

Minimum Maximum

One word 10 words

Test Data Positive Negative


Enter Alpha numeric’s Enter unrelated subject data also
Enter related subject it accepts

ECP:-

Valid In_Valid
Select CC or BCC Selection of CC or BCC

BSV

Minimum Maximum

-- ---

Test Data Positive Negative


Select the CC/BCC Not select the CC/BCC
6
Specification: Attachments other files

If you want to add to extra details of the form of attachments line documents, pictures other files.

Valid In_Valid
Images, Documents
Videos Entered data directly
Audio’s
BSV

Minimum Maximum

0 MB 512 MB

Test Data Positive Negative


Select the attachments Selected the unattached file
Specification: - Text Area

If you want to enter any message related to what you want to send the sender

Valid In_Valid
alphanumeric ---
A-Z ---
a-z ---
0-9 ---
BSV

Minimum Maximum

1 word >1 word

Test data

Positive Negative
Enter any type of data Other than data we should enter
the text area

7
Lab Experiments
Using
Quick Test Professional 10.0

8
3. (a) Aim: Functional Testing of a standard calculator Application using QTP 10.0
Procedure:
i) Normal Mode
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on “Record” Button and Go to Windows Applications
Step 4: Click on ‘+’ Symbol and add Calculator application to the QTP Environment.
Step 5: Click “Apply” and Click “Ok” Buttons.
Step 6: Perform basic arithmetic operations such as Add, Subtract, Multiply and Division.
Step 7: Close the Calculator Application and Click on “Stop” Button
Step 8: The following VB Script will be generated based on the actions of a tester.
Window("Calculator").WinButton("Button").Click
Window("Calculator").WinButton("Button_2").Click
Window("Calculator").WinButton("Button_3").Click
Window("Calculator").WinButton("Button_4").Click
Window("Calculator").WinButton("Button_5").Click
Window("Calculator").WinButton("Button_6").Click
Window("Calculator").WinButton("Button_4").Click
Window("Calculator").WinButton("Button_7").Click
Window("Calculator").WinButton("Button_6").Click
Window("Calculator").WinButton("Button_8").Click
Window("Calculator").WinButton("Button_4").Click
Window("Calculator").WinButton("Button_9").Click
Window("Calculator").WinButton("Button_10").Click
Window("Calculator").WinButton("Button_8").Click
Window("Calculator").WinButton("Button_4").Click
Window("Calculator").Close
Step 9: Go to “Run” button -> Click on “OK”
Step 10: Analyze the test results window with “Done” status.
Step 11: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in the
selected drive in the system and also save the VB Script also from QTP Envt.

9
Test Results Window:

10
ii) Analog Mode
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on “Record” Button and Go to Windows Applications
Step 4: Click on ‘+’ Symbol and add Calculator application to the QTP Environment.
Step 5: Click “Apply” and Click “Ok” Buttons.
Step 6: In the Automation tab, select analog mode for recording
Step 7: Perform basic arithmetic operations such as Add, Subtract, Multiply and Division.
Step 8: Close the Calculator Application and Click on “Stop” Button
Step 9: The following VB Script will be generated based on the actions of a tester.
Desktop.RunAnalog "Track1"
Step 10: Go to “Run” button -> Click on “OK”
Step 11: Analyze the test results window with “Done” status.
Step 12: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in the
selected drive in the system and also save the VB Script also from QTP Envt.

Test Results Window:

11
iii) Low Level Recording Mode
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on “Record” Button and Go to Windows Applications
Step 4: Click on ‘+’ Symbol and add Calculator application to the QTP Environment.
Step 5: Click “Apply” and Click “Ok” Buttons.
Step 6: In the Automation tab, select low level recording mode for recording
Step 7: Perform basic arithmetic operations such as Add, Subtract, Multiply and Division.
Step 8: Close the Calculator Application and Click on “Stop” Button
Step 9: The following VB Script will be generated based on the actions of a tester.
Window("Login").WinObject("Agent Name:").Click 37,7
Window("Login").WinObject("Agent Name:").Type "mercury"
Window("Login").WinObject("Password:").Click 61,10
Window("Login").WinObject("Password:").Type "mercury"
Window("Login").WinObject("OK").Click 19,9
Window("Flight Reservation").WinObject("Date of Flight:").Type "122616"
Window("Flight Reservation").WinObject("Fly From:").Click 96,13
Window("Flight Reservation").WinObject("Fly To:").Click 94,10
Window("Flight Reservation").WinObject("FLIGHT").Click 35,35
Window("Flight Reservation").Window("Flights Table").WinObject("From").Click 251,71
Window("Flight Reservation").Window("Flights Table").WinObject("OK").Click 40,13
Window("Flight Reservation").WinObject("Name:").Type "kiran"
Window("Flight Reservation").WinObject("Insert Order").Click 32,13
Window("Flight Reservation").Close
Step 10: Go to “Run” button -> Click on “OK”
Step 11: Analyze the test results window with “Done” status.
Step 12: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in the
selected drive in the system and also save the VB Script also from QTP Envt.

12
13
(b) Functional Testing of a Flight Reservation Application using QTP 10.0
Procedure:
i) Normal Mode
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on “Record” Button and Go to Windows Applications
Step 4: Click on ‘+’ Symbol and add Flight application to the QTP Environment.
Step 5: Click “Apply” and Click “Ok” Buttons.
Step 6: perform necessary steps to reserve a flight ticket with an order number.
Step 7: Close the Flight Application and Click on “Stop” Button
Step 8: The following VB Script will be generated based on the actions of a tester.
Dialog("Login").WinEdit("Agent Name:").Set "nani"
Dialog("Login").WinEdit("Password:").SetSecure"529070fe36f4ba8c0ab8d4f23ff86b2
e1aab2a5d"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").WinMenu("Menu").Select "File;New Order"
Window("Flight Reservation").ActiveX("MaskEdBox").Type "121115"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Frankfurt"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Denver"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "20130
FRA 12:48 PM DEN 01:33 PM SR $168.50"
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "obulesu"
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"

Step 9: Go to “Run” button -> Click on “OK”


Step 10: Analyze the test results window with “Done” status.
Step 11: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in
the selected drive in the system and also save the VB Script also from QTP Envt.

14
Test Results Window:

15
ii) Analog Mode
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on “Record” Button and Go to Windows Applications
Step 4: Click on ‘+’ Symbol and add Flight application to the QTP Environment.
Step 5: Click “Apply” and Click “Ok” Buttons.
Step 6: In the Automation tab, select analog mode for recording
Step 7: perform necessary steps to reserve a flight ticket with an order number.
Step 8: Close the Flight Application and Click on “Stop” Button
Step 9: The following VB Script will be generated based on the actions of a tester.
Desktop.RunAnalog "Track1"
Step 10: Go to “Run” button -> Click on “OK”
Step 11: Analyze the test results window with “Done” status.
Step 12: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in
the selected drive in the system and also save the VB Script also from QTP Envt.

Test Results Window:

16
iii) Low Level Mode
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on “Record” Button and Go to Windows Applications
Step 4: Click on ‘+’ Symbol and add Flight application to the QTP Environment.
Step 5: Click “Apply” and Click “Ok” Buttons.
Step 6: In the Automation tab, select low level mode for recording
Step 7: perform necessary steps to reserve a flight ticket with an order number.
Step 8: Close the Flight Application and Click on “Stop” Button
Step 9: The following VB Script will be generated based on the actions of a tester.
Window("Login").WinObject("Agent Name:").Click 14,9
Window("Login").WinObject("Agent Name:").Type "mercury"
Window("Login").WinObject("Password:").Click 51,1
Window("Login").WinObject("Password:").Type "mercury"
Window("Login").WinObject("OK").Click 38,12
Window("Flight Reservation").WinObject("Date of Flight:").Type "122616"
Window("Flight Reservation").WinObject("Fly From:").Click 96,13
Window("Flight Reservation").WinObject("Fly To:").Click 94,10
Window("Flight Reservation").WinObject("FLIGHT").Click 35,35
Window("Flight Reservation").Window("Flights Table").WinObject("From").Click 251,71
Window("Flight Reservation").Window("Flights Table").WinObject("OK").Click 40,13
Window("Flight Reservation").WinObject("Name:").Type "kiran"
Window("Flight Reservation").WinObject("Insert Order").Click 32,13
Window("Flight Reservation").Close
Step 10: Go to “Run” button -> Click on “OK”
Step 11: Analyze the test results window with “Done” status.
Step 12: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in
the selected drive in the system and also save the VB Script also from QTP Envt.

17
Test Results Window:

18
4. Aim: To a) Create a new project b) Create a new Action
c) Set Action Properties d) Splitting Actions
Procedure:
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on “Record” Button and Go to Windows Applications
Step 4: Click on ‘+’ Symbol and add Flight application to the QTP Environment.
Step 5: Click “Apply” and Click “Ok” Buttons.
Step 6: Enter the login name and password in the Flight application Login form. Flight
application will be opened. The following VB Script will be generated in the expert view.
Dialog("Login").WinEdit("Agent Name:").Set "mercury"
Dialog("Login").Click 61,159
Dialog("Login").WinEdit("Password:").SetSecure "581b8c36290ee435f8e28e8
fe994cf5340e4ffdf"
Dialog("Login").WinButton("OK").Click
Step 7: Just close the flight application. The following VB Script will be generated in the expert
view.
Window("Flight Reservation").Close
Step 8: Save the Test as Test1 and keep the cursor at the end of the line of Window("Flight
Reservation").Close and then click on split action in the tool bar and Select action as
Independent Of Each Other .
Step 9: Name the first action name as login and name the second action name as logout such that
last line will appear in logout remaining lines will appear in login action respectively.
Step 10: Goto keyword view and change the action properties of login action as Non-Resuable
Action and logout as Reusable action.
Step 11: Open new test and save it as Test2.
Step 12: In Test2 again open the flight application and open an order by giving order number as
“1”. Keep the VB script code related to open order by removing login and logout information in
expert view. The code will be as follows:
Window("Flight Reservation").WinMenu("Menu").Select "File;Open Order..."
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set
"ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set "1"
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click

19
Step 13: Goto keyword view and select open order -> edit -> click on “1” -> In the pop up
window change the parameter Name as “OrderNumber” and then select datatable as Current
Action Sheet(local)
Step 14: In the data sheet enter order numbers that are wanted to view. (eg: 1,4,5 etc)
Step 15: Change the action name Action1 as BookFlight in Test2 in keyword view and change
the action property as non-resuable action.
Step 16: Click on “call to copy of Action” in the toolbar and select login action from Test1.
Step 17: Click on “call to Existing Action” in the toolbar and select logout action from Test1.
Step 18: Properly rearrange the actions such that login must be the first action then BookFlight
will be the second action and logout will be the last action.
Step 19: Go to “Run” button -> Click on “OK”
Step 20: Analyze the test results window with “Done” status.
Step 21: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in
the selected drive in the system and also save the VB Script also from QTP Envt.

Test Results Window:

20
5. Aim: Analyzing local and shared object repository.
Procedure:
a) Local Object Repository
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on Insert Tab and select call to New Action such that two actions namely Action1
and Action2 will be created.
Step 4: Goto Action1
Step 5: Open the flight application login dialog from start menu
Step 6: Click on object repository in tool bar (looks like database symbol) then object repository
will be opened in a new window.
Step 7: Click on Add objects to Local and select Agent Name in the flight login dialog window.
Step 8: Click on Add objects to Local and select Password in the flight login dialog window.
Step 9: Click on Add objects to Local and select OK button in the flight login dialog window.
Step 10: Drag the object Agent Name into the expert view and the corresponding code will be
generated in the expert view and set the agent name as “Mercury”
Step 11: Drag the object Password into the expert view and the corresponding code will be
generated in the expert view and set the password as “Mercury”
Step 12: Go to “Run” button -> Click on “OK”
Step 13: Analyze the test results window with “Done” status. The following report will be
generated.

21
Step 14: Copy the code in the expert view of Action1 into Action2.
Step 15: Open the flight application login dialog from start menu
Step 16: Go to “Run” button -> Click on “OK”
Step 17: Analyze the test results window with “Done” status. The following report will be
generated.

Analysis of Local Object Repository


 Local Object Repository is the default object repository
 It is specific to actions and can be used only for a particular action
 Local Object Repository is preferable when application is not dynamic with respect to
time
 Local Object Repository cannot be reused
 We can perform many operations in the local object repository such as -
 Highlight an object stored in repository on the application under test
 Check whether a particular object in your AUT is stored in the Object Repository
 Cut , Copy , Paste , Modify and Delete Objects
 In case you have accidentally modified the value of a property you can update its
description from the application using update function.

22
b) Shared Object Repository
Step 1: Creating a Shared Object Repository
 To create a Shared Object Repository, in the Local Object Repository Dialog Box of
Action1 (ie in the lab exercise 5a Local object repository ), Click File - > Export Local
Objects
 Repository files have an extension .tsr .Give a suitable name say "data" and save
 The Shared Repository File is now created
Step 2)Associating a Shared Object Repository
 Next step is to associate the repository to our test, which enables us to use it
 To associate repository with a test, Click Resources-> Associate Repository
 We can select the Repository to associate with Actions available in our test.
 Now we can use this shared repository to develop our test
Step 3) Editing a Shared Object Repository
 We can use the Object Repository Manager to Edit a Share Repository.
 Select Resources -> Object Repository Manager .Open the Object Repository we created
"data"
 By Default, Repository is opened in Read-only mode. To enable editing click File ->
Enable Editing
 Once editing is enabled we can perform all the operations like cut, copy, paste, rename
objects etc that we can also do in Object Repository
 Using Object Repository Manager we can compare two Object Repositories. QTP will
give us a statistics of what's unique and common in both the repositories
 We can use the Object repository merge tool to merge two repositories into one

Analysis of Shared Object Repository


 Global or Shared Object Repository is preferable when application is dynamic and object
description change frequently
 Between Shared and local object repository, shared object repository is more commonly
used in automation projects
 However, it has maintenance and administration overheads as compared to local object
repository.

23
6) Aim: Implementation of Checkpoints Using QTP 10.0
a. Standard Checkpoint b. Text Checkpoint c. Bitmap Checkpoint
b. Database Checkpoint
(a) Procedure for standard Checkpoint:
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on “Record” Button and Go to “Windows Applications”
Step 4: Click on ‘+’ Symbol and add Calculator application to the QTP Environment.
Step 5: Click “Apply” and Click “Ok” Buttons.
Step 6: Go to Insert -> Checkpoint -> Standard Checkpoint -> Select the Button and
expected values of properties such as height, Width values should be “27” & “34”.
Step 7: Close the Calculator Application and Click on “Stop” Button
Step 8: The following VB Script will be generated based on the actions of a tester.
Window("Calculator").WinButton("Button").Check CheckPoint("Button")
Window("Calculator").Close
Step 9: Go to “Run” button -> Click on “OK”
Step 10: Analyze the test results window with “Done” status.
Step 11: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in
the selected drive in the system and also save the VB Script also from QTP Envt.

Test Results Window:

24
(b) Procedure for Text Checkpoint:
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on “Record” Button and Go to “Windows Applications”
Step 4: Click on ‘+’ Symbol and add Calculator application to the QTP Environment.
Step 5: Click “Apply” and Click “Ok” Buttons.
Step 6: Go to Insert -> Checkpoint -> Text Checkpoint -> Select any button in the
calculator or other text which you want to test
Step 7: Close the Calculator Application and Click on “Stop” Button
Step 8: The following VB Script will be generated based on the actions of a tester.
Window("Calculator").WinButton("8").Check CheckPoint("8")
Window("Calculator").Close
Step 9: Go to “Run” button -> Click on “OK”
Step 10: Analyze the test results window with “Done” status.
Step 11: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in
the selected drive in the system and also save the VB Script also from QTP Envt.

Test Results Window:

25
(c) Procedure for Bitmap Checkpoint:
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Open the flight reservation application and go to help.
Step 5: Click on Record button and go to “Windows Application”
Step 6: Select Record and run test on any open Windows based application then click on
“Apply” and Click “Ok” Buttons.
Step 7: Go to Insert -> Checkpoint -> Bitmap Checkpoint -> Select the image in flight
Reservation window.
Step 8: The following VB Script will be generated based on the actions of a tester.
Window("Flight Reservation").Dialog("About Flight Reservation”).
WinButton(“Button”).Check CheckPoint(“Button”)
Step 9: Go to “Run” button -> Click on “OK”
Step 10: Analyze the test results window with “Done” status.
Step 11: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in
the selected drive in the system and also save the VB Script also from QTP Envt.

Test Results Window:

26
Test Results Window(failed):

27
(d) Procedure for Database Checkpoint:
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Go to Insert -> Checkpoint -> Database Checkpoint ->Create Query using Microsoft
Query-> choose data source as MS ACCESS database -> Select a MS Access
Database->Choose the Columns in Query Wizard -> Click the next buttons and back to
QTP 10.0
Step 4: The following VB Script will be generated based on the actions of a tester.
DbTable("DbTable").Check CheckPoint("DbTable")
Step 5: Go to “Run” button -> Click on “OK”
Step 6: Analyze the test results window with “Done” status.
Step 7: Go to keyword view change the values and analyse the test results again.
Step 8: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in
the selected drive in the system and also save the VB Script also from QTP Envt.

Test Results Window:

28
7. Aim: Applying Data Table, Flat File and Environment Variable parameterization.
Procedure:
a) Data Table Parameterization:
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on “Record” Button and Go to Windows Applications
Step 4: Select first radio button in windows applications that is

Step 5: Click “Apply” and Click “Ok” Buttons.


Step 6: Open flight application from start menu and enter agent name, password and click
on ok button.
Step 7: Flight reservation application will be opened then click on close button and stop
recording.
Step 8: In the expert view we can see the following code:
Dialog("Login").WinEdit("Agent Name:").Set "giri"
Dialog("Login").WinEdit("Password:").SetSecure "582576299a4a39a4e687c96
bcd77e83e3a2983bc"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Close
Step 9: Add the following statement as the first line in expert view to open the flight
application.
systemutil.Run "C:\Program Files (x86)\HP\QuickTest Professional\samples\flight\app
\flight4a.exe"
Step 10: Goto keyword view and click on the property value of agent name such that dialog will
be opened. In that select the parameter as Data Table, change the parameter name as AgentName
and then click on ok button.
Step 11: At the bottom of QTP environment the data table will be displayed with AgentName
column with a single value, there enter wanted number of agent names in each row.
Step 12: In the keyword view click on the property value of password such that dialog will be
opened. In that select the parameter as Data Table, change the parameter name as Password and
then click on ok button.
Step 13: At the bottom of QTP environment the data table will be displayed with Password
column with a single value, there enter wanted number of passwords as mercury in each row.

29
Step 14: Go to “Run” button -> Click on “OK”
Step 15: Analyze the test results window with “Done” status.
Step 16: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in
the selected drive in the system and also save the VB Script also from QTP Envt.

Test Results Window:

30
b) Flat File Parameterization:
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on “Record” Button and Go to Windows Applications
Step 4: Select first radio button in windows applications that is

Step 5: Click “Apply” and Click “Ok” Buttons.


Step 6: Open flight application from start menu and enter agent name, password and click
on ok button.
Step 7: Flight reservation application will be opened then click on close button and stop
recording.
Step 8: In the expert view we can see the following code:
Dialog("Login").WinEdit("Agent Name:").Set "giri"
Dialog("Login").WinEdit("Password:").SetSecure "582576299a4a39a4e687c96
bcd77e83e3a2983bc"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Close
Step 9: Add the following statement as the first line in expert view to open the flight
application.
systemutil.Run "C:\Program Files (x86)\HP\QuickTest Professional\samples\flight\app
\flight4a.exe"
Step 10: At the bottom of QTP environment the data table will be displayed. In the Data Table
right click on the mouse -> select File -> select import file -> Select the flat file (note pad file
which contains agent names and passwords separated by tab spaces and contains headernames as
AgentName and Password respectively) -> The data will be loaded into the Data Table.
Step 11: Go to “Run” button -> Click on “OK”
Step 12: Analyze the test results window with “Done” status.
Step 13: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in
the selected drive in the system and also save the VB Script also from QTP Envt.

31
Test Results Window:

32
c) Environment Variable Parameterization:
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on “Record” Button and Go to Windows Applications
Step 4: Select first radio button in windows applications that is

Step 5: Click “Apply” and Click “Ok” Buttons.


Step 6: Open flight application from start menu and enter agent name, password and click
on ok button.
Step 7: Flight reservation application will be opened then click on close button and stop
recording.
Step 8: In the expert view we can see the following code:
Dialog("Login").WinEdit("Agent Name:").Set "giri"
Dialog("Login").WinEdit("Password:").SetSecure "582576299a4a39a4e687c96
bcd77e83e3a2983bc"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").Close
Step 9: Add the following statement as the first line in expert view to open the flight
application.
systemutil.Run "C:\Program Files (x86)\HP\QuickTest Professional\samples\flight\app
\flight4a.exe"
Step 10: Goto file menu -> select settings -> select environment variable -> select user-defined
variable -> click on plus button -> enter parameter name as Agentname-> enter parameter value
as Mercury. Again click on plus button -> enter parameter name as password -> enter parameter
value as Mercury-> click on ok button at the bottom.
Step 11 : Goto keyword view and then select property agentname such that a dialog will be
opened in that select parameter as environment -> select name as AgentName -> click on ok
button.
Step 12 : In the keyword view select property password such that a dialog will be opened in that
select parameter as environment -> select name as password -> click on ok button.
Step 13: Go to “Run” button -> Click on “OK”
Step 14: Analyze the test results window with “Done” status.
Step 15: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in

33
the selected drive in the system and also save the VB Script also from QTP Envt.

Test Results Window:

34
8. Aim: Applying Synchronization point on Flight Reservation Application using QTP 10.0
Procedure:
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on “Record” Button and Go to Windows Applications
Step 4: Click on ‘+’ Symbol and add Flight application to the QTP Environment.
Step 5: Click “Apply” and Click “Ok” Buttons.
Step 6: Enter the flight details and then click on insert order
Step 7: To create a synchronization point on update order button goto insert tab -> select
synchronization point -> click on update order
Step 8: A dialog box will be opened then press ok button. Change the property as enabled and
change property value as 1(indicates true). Click on ok button and exit from flight application.
Step 9: The following VB Script will be generated based on the actions of a tester.
Dialog("Login").WinEdit("Agent Name:").Set "mercury"
Dialog("Login").WinEdit("Password:").SetSecure
"5820a6b06523b66da5df93e7b7ef6a7565824644"
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").ActiveX("MaskEdBox").Type "122616"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Frankfurt"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Los Angeles"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "20334
FRA 12:12 AM LAX 07:23 PM AA $112.20"
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "kiran"
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").WinButton("Update Order").WaitProperty "enabled", 1,
10000
Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"
Step 10: Go to “Run” button -> Click on “OK”
Step 11: Analyze the test results window with “Done” status.
Step 12: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in
the selected drive in the system and also save the VB Script also from QTP Envt.

35
Test Results Window:

36
9. Applying Object Spying on Flight Application using QTP 10.0
Procedure:
Step 1: Open HP QTP 10.0 Application
Step 2: Go to File -> New -> Test
Step 3: Click on “Record” Button and Go to Windows Applications
Step 4: Click on ‘+’ Symbol and add Flight application to the QTP Environment.
Step 5: Click “Apply” and Click “Ok” Buttons.
Step 6: In the Login Dialog enter Agent Name and stop recording. The following VBScript
will be generated in the expert view.
Dialog("Login").WinEdit("Agent Name:").Set "sfgsdfg"
Step 7: Edit the code statement as given below
Dialog("Login").WinEdit("Agent Name:")
Step 8: Click on object spy in the toolbar. A dialog window will be opened.
Step 9: In the dialog window click on the button with hand icon and then click on the agent
name in the flight application login dialog window. Properties of the selected
component will be displayed in the spy dialog window. Then click on close button.
Step 10: In the QTP environment in the Expert View type the following code:
val = Dialog("Login").WinEdit("Agent Name:").GetROProperty("focused")
If val Then
Reporter.ReportEvent micPass,Focus,Enabled
Else
Reporter.ReportEvent micFail,Focus,DisEnabled
End If
Step 11: Go to “Run” button -> Click on “OK”
Step 12: Analyze the test results window with “Done” status.
Step 13: Go to File -> Export Report -> Select PDF Type -> Ok -> Save the test result in
the selected drive in the system and also save the VB Script also from QTP Envt.

37
Test Results Window:

38
10. Aim: To create VUser script using virtual user generator for WebTours application.

Procedure:
Step 1: Start LoadRunner: Choose Start > Programs > Mercury LoadRunner > LoadRunner.
The Mercury LoadRunner Launcher window opens.
Step 2: Open VuGen: In the Launcher window, click the Load Testing tab. Click Create/Edit
Scripts. VuGen’s Start Page opens.
Step 3: Create a blank Web script: Click New Vuser Script in the Scripts tab in the VuGen
Start Page. The New Virtual User dialog box opens, displaying the options for a new single
protocol script. Scroll down the list, select Web (HTTP/HTML), and click OK to create an empty
Web script.
Step 4: Click the Record button on the VuGen toolbar. The Start Recording dialog box opens.
In the URL address box, type http://localhost:1080/MercuryWebTours/. In the Record into
Action box, choose Action. Click OK. A new Web browser opens and displays the Mercury
Tours site.
[Note: If there is an error opening the site, make sure that the web server is running. To start the
server choose Start > Programs > Mercury LoadRunner > Samples > Web > Start Web Server.]
Step 5: Log on to the Mercury Tours Web site. For the Member Name enter jojo and for the
Password enter bean. Click Login. A welcome page opens.
Step 6: Enter flight details.
Click Flights. The Find Flight page opens:
➤ Departure City: Denver (default)
➤ Departure Date: Keep the default, current date
➤ Arrival City: Los Angeles
➤ Return Date: Keep the default, tomorrow’s date.
➤ Seating Preference: Aisle
Keep the rest of the default settings and click Continue. The Search Results page opens.
Step 7: Select a flight. Click Continue to accept the default flight selections. The Payment
Details page opens.
Step 8: Enter payment information and book flight. Enter 12345678 in the Credit Card box and
type 06/06 in the Exp Date box. Click Continue. The Invoice page opens, displaying your
invoice.
Step 9: Check the itinerary. Click Itinerary in the left pane. The Itinerary page opens.
Step 10: Click Sign Off in the left pane.

39
Step 11: Click Stop on the floating toolbar to stop the recording process.
Step 12: The Code Generation pop up window opens while the Vuser script is being generated.
The VuGen wizard then automatically proceeds to the next step in the task pane and displays the
recording summary. (If you do not see the summary, click Recording Summary in the Task
pane.)

Result:

40
41

Vous aimerez peut-être aussi