qtp student work book - amazon s3 · now, in login window, enter username as “seed” and...

37
Learning QuickTest Professional Student Work Book v2009.0

Upload: others

Post on 27-Mar-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Learning QuickTest Professional

Student Work Book v2009.0

Page 2: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 2 Exercise

SEED Infotech Ltd.

Table of Contents

Sr. No Module Page No

1. Lab 1 Assignment for Normal Mode Recording 3

2. Lab 2 Assignment for Analog Mode Recording 4

3. Lab 3 Assignment for adding a synchronization point while recording

5

4. Lab 4 Data Driven Testing 7

5. Lab 5 Assignment for standard Checkpoint while Recording

11

6. Lab 6 Assignment for Text area Checkpoint (Using Flight Application)

14

7. Lab 7 Assignment for Text Checkpoint (Using Mercury Tours)

17

8. Lab 8 Assignment for Bitmap Checkpoint (Using Flight Application)

18

9 Lab 9 Assignment for Database Checkpoint (Using Flight Application database)

19

10 Lab 10 Creating multiple actions in a script like login, Insert Order and Logout.

21

11 Lab 11 Assignment for making use of Call to Existing Action

23

12 Lab 12 Assignment for making use of Call to Action. 25

13 Lab 13 Making use of per-action Mode 27

14 Lab 14 Regular Expression 31

15 Lab 15 Use the recovery scenario Manager 33

Page 3: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 3 Exercise

SEED Infotech Ltd.

Lab 1 Assignment for Normal Mode Recording 1. Start QTP & Create New Test File ? New ? Test A blank test opens 2. Click on Record button.

Automation ? Record or click on record button. Record and Run settings Dialog box opens. Always select option for Windows Application & Select option “Record and run test on any open Windows-based application”. Click on OK button. 3. Start Recording from Start > Programs > QTP Professional > Sample applications > Flight application. (Login window displayed) Steps on Application Now, in Login Window, enter username as “seed” and password as “mercury”. On Flight Reservation window, use menu to close application. 4. Stop Recording. Script generated as follows:

Note: Similar way you can record a script for Flight application’s other functionalities as well and on any windows application.

5. Run the test

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" Dialog("Login").WinEdit("Agent Name:").Set "seed" Dialog("Login").WinEdit("Password:").SetSecure "443c880fd080bda63f43df" Dialog("Login").WinButton("OK").Click Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"

Page 4: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 4 Exercise

SEED Infotech Ltd.

Lab 2 Assignment for Analog Mode Recording 1. Start QTP & open the new test File ? New ? Test A blank test opens 2. Click on Record button.

Automation ? Record or click on record button. Record and Run settings Dialog box opens. Always select option for windows Application & Select option “Record and run test on any open Windows-based application”. Click on OK button. Steps on Application 3. Start Recording from Start > Programs > Accessories > Paint.exe (Paint application window displayed) 4. To start Analog recording, go to Automation ? Analog recording. 5. You will get Analog Recording settings,

6. Select option, “Record relative to following window” (Option suggests, co-ordinates are recorded from Window (0, 0) positions) 7. Now Click on Hand Button, Drag Hand & Drop on Paint window, Title bar. 8. Click on “Start Analog Record” 9. Record the drawing & close the application. 10. Stop Recording.

Script generated as follows:

11. Run the test

SystemUtil.Run "C:\WINNT\System32\mspaint.exe","","C:\WINNT\System32","open" Window("Paint").Activate Window("Paint").RunAnalog "Track1"

Page 5: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 5 Exercise

SEED Infotech Ltd.

Lab 3 Assignment for adding a synchronization point while recording 1. Start QTP & open the new test File ? New ? Test A blank test opens 2. File ? Settings In Run Tab, change “Object Synchronization time out” from 20 to 5 2. Start recording .

Automation ? Record or click on record button. Record and Run settings Dialog box opens Always select windows Application & Record and run test on any application. Click on ok button Steps on Application 3. Start Recording from Login Window to Insert order. Add a Synchronization point for insert order process. Choose Insert -> Synchronization point and select that “Insert Order” button

After selecting that button you will see an “Object Selection-Synchronization Point” window.

Page 6: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 6 Exercise

SEED Infotech Ltd.

4. After clicking on “OK” button on the above window, you will see “Add Synchronization Dialog” box. Select Property name as enabled, Property value as false and set Timeout as 10000 msec.

Clicking on Ok button you will get following statement inserted in your QTP script.

Window("Flight Reservation").WinButton("Insert Order").WaitProperty "enabled", false, 10000

Page 7: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 7 Exercise

SEED Infotech Ltd.

Lab 4 Data Driven Testing Concept of Parameterization: When you test your applications, you may want to check how it performs the same operations with multiple sets of data. For example, suppose you want to check how your Login Application responds to ten separate sets of data (Agent Name & password), probably you could record ten separate tests, each with its own set of data. Alternatively, you can create Data Table parameters so that your test runs ten times, each time using a different set of data. This is called as Parameterization. Each QTP has two types Data sheets (Data table) one is Global datasheet and other is Local Datasheet. Global sheet can have parameters related to any action Local sheet will be there for each action i.e. Action1, Action2 etc so named as Action1 Action2 etc. Data Driven Testing (DDT): When you test your application, you may want to check how it performs the same operations with multiple sets of data. This type of testing is called as Data Driven Testing. To do DDT, you need to do parameterization. We can do parameterization by two ways, 1 Expert View 2. Data Driver. Example we want to test Login Activity for Multiple Agent Name & password. Parameterization through Expert View:

1. Decide the parameters which you want to Parameterize. 2. Go to Expert view.

3. Click on that parameter and select Configure the Value 4. Select parameter Radio button and enter username as Name

Click on OK button. The username and the value appears in your Global Datasheet. Assume you have parameterized password in same way you will have following Datasheet.

Page 8: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 8 Exercise

SEED Infotech Ltd.

Parameterization through Data Driver: Choose Tools > Data Driver. The Data Driver scans the test for constants and then the Data Driver opens. The Data Driver enables you to quickly parameterize several (or all) objects, methods, and/or checkpoints containing the same constant value within a given action.

Here you have to click on Parameterize button to parameterize respected field. While doing parameterization you will get following screens

Page 9: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 9 Exercise

SEED Infotech Ltd.

In this screen you should select Step by Step parameterization. After clicking on next button of this screen you have to choose the option parameter and create a variable name which you want to use in Datasheet

Click on next button to get congratulations screen. Then do the same thing for the Password field. Then you will get following screen.

Page 10: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 10 Exercise

SEED Infotech Ltd.

Click on Ok button. Statements in your script get modified because of parameterization as follows.

As here while doing parameterization we have not selected any particular action so you are getting dtGlobalSheet. The script executes for number of iterations which is equal to the number of records in Datasheet. Assume you have two agent name User 1 & User2, then you will get following kind of

Dialog("Login").WinEdit("Agent Name:").Set DataTable("agentname", dtGlobalSheet) Dialog("Login").WinEdit("Password:").Set DataTable("Passowrd", dtGlobalSheet) Dialog("Login").WinButton("OK").Click

Page 11: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 11 Exercise

SEED Infotech Ltd.

Lab 5 Assignment for standard Checkpoint while Recording 1. Start QTP & open the new test File ? New ? Test A blank test opens 2. Click on Record button.

Automation ? record or click on record button. Record and Run settings Dialog box opens. Always select option for windows Application & Select option “Record and run test on any open Windows-based application”. Click on OK button. Login to the application and you will see Flight Reservation window 3.Choose to Insert ? Checkpoint ? Standard checkpoint

.

5. Select the object for which you want to insert a standard checkpoint. In this case, for flight No object which is initially disabled. You will get the Object selection checkpoint Properties Dialog.

5. Now select the properties, which you want to check. We will select Enabled Property.

Page 12: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 12 Exercise

SEED Infotech Ltd.

Page 13: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 13 Exercise

SEED Infotech Ltd.

6. In the same way if you can to insert the checkpoint for other object like Radio Button, Combo Box etc. Script statements inserted as follows. Test Result Analysis

Script for Edit Box: Window("Flight Reservation").WinEdit("Flight No:").Check CheckPoint("Flight No:") Script for Radio Button: Window("Flight Reservation").WinRadioButton("First").Check CheckPoint("First") Script for Radio Button: Window("Flight Reservation").WinComboBox("Fly From:").Check CheckPoint("Fly From:")

Page 14: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 14 Exercise

SEED Infotech Ltd.

Lab 6 Assignment for Text area Checkpoint (Using Flight Application) 1. Start QTP & open the new test File ? New ? Test A blank test opens 2. Click on Record button. Automation ? record or click on record

button. Record and Run settings Dialog box opens. Always select option for windows Application & Select option “Record and run test on any open Windows-based application”. Click on OK button.

3. Start recording and Choose Insert ? Checkpoint ? Text Area Checkpoint. After clicking on this Menu you will have to select Text which is to be checked.

4. Assume you want to check the text Total Tickets Sold: 35 which comes in Analysis ? Graph of Flight Reservation Window.

5. After capturing the text

by the pointer, Total Tickets Sold : 35 you will see the following Dialog

Click on OK button

6. You will see Text Area Checkpoint Properties Dialog in, which you can configure the text. For example, you want to check the text between the words.

Page 15: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 15 Exercise

SEED Infotech Ltd.

Click on Configure button. 7. After clicking on the Configure button, you will get Configure Text Selection Dialog, in which you can select text to be checked, or text before or text after.

Page 16: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 16 Exercise

SEED Infotech Ltd.

8. It will show you the conditions on the text through the Text Area Checkpoint Properties Dialog.

Click on OK button. The script for Checkpoint looks like this:

Window ("Flight Reservation"). Dialog ("Graph").Check Checkpoint("Tickets Sold:")

Page 17: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 17 Exercise

SEED Infotech Ltd.

Lab 7 Assignment for Text Checkpoint (Using Mercury Tours)

Text Check point checks the text as per expected result. If you are expecting a message, Note: Your user name is abc. (Entire text/message) and you have to specifically check the user name.

1. Start QTP & open the new test File ? New ? Test A blank test opens 2. Start recording. Automation ? record or click on record button. Record and Run settings Dialog box opens 3. Start recording on “Mercury Tours” web page. Steps on Application

4. Register the username & password till you get message, Note: Your user name is abc.

5. Go to Insert > Checkpoints > Text Check point. Put check point on that message.

6. You can configure the message with the help of “Configure” button. Your configured text should look like as shown in following Image.

Script generated looks like this:

Note: Same procedure you can apply on any text of

web page or for windows based application.

Browser("Register: Mercury").Page("Register: Mercury").Check CheckPoint("abc")

Page 18: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 18 Exercise

SEED Infotech Ltd.

Lab 8 Assignment for Bitmap Checkpoint (Using Flight Application)

1. Start QTP & open the new test File ? New ? Test A blank test opens 2. Click on Record button.

Automation ? record or click on record button. Record and Run settings Dialog box opens. Always select option for windows Application & Select option “Record and run test on any open Windows-based application”. Click on OK button.

3. First, manually open the Flight Reservation window. 4. Start Recording, 5. Insert Checkpoint on Bitmap present on Main Flight window. 6. Choose Insert -> Checkpoint -> Bitmap Checkpoint. 7. Select the entire image

8. Selected bitmap you can check into Bitmap

check point properties.

9. With the help of “Select Area” you can insert check point for selected area of image. 10. You can set the Checkpoint timeout. 11. Syntax generated for this checkpoint is,

For Flight Reservation window Image: Window("Flight Reservation").Static("Static").Check CheckPoint("Static")

Page 19: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 19 Exercise

SEED Infotech Ltd.

Lab 9 Assignment for Database Checkpoint (Using Flight Application database) 1. Start QTP & open the new test File ? New ? Test A blank test opens 2. Insert Database check point, Insert > checkpoints > Database Checkpoint. 3. Here, Run the wizard as per instructions, 4. First select the option, Specify SQL statement manually. 5. Specify the DSN, by clicking on “Create” button.

( MachineDSN=QT_Flight32; DBQ=C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight32.mdb; (Flight database) ) Query: select * from orders;

6. Click on Finish. The database checkpoint properties window shall be displayed

Page 20: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 20 Exercise

SEED Infotech Ltd.

7. You can select the data (cells) to be tested. Blue marked (?) indicates, cell to be tested. If you

double click on that cell you can toggle the check. 8. Click on OK, to complete the check point. 9. Statement generated for this check point. 10. If you want to modify the checkpoint you can edit it, by opening the checkpoint properties

through tree view. Note: You can create your own database, DSN & apply the check point on that table.

DbTable("DbTable").Check CheckPoint("DbTable")

Page 21: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 21 Exercise

SEED Infotech Ltd.

Lab 10 Creating multiple actions in a script like login, Insert Order and Logout. 1. Start QTP & open the new test File ? New ? Test A blank test opens 2. Click on Record button.

Automation ? record or click on record button. Record and Run settings Dialog box opens. Always select option for windows Application & Select option “Record and run test on any open Windows-based application”. Click on OK button. 3. Choose Edit ? Action ? Action Properties.

Change Name to “login” Click OK button to make login action as reusable. If you do not want to make it Reusable do not check the checkbox for Reusable action Steps on Application Record Login, viz enter username and password and Click “OK” and stop recording 4. Then in the same test choose Insert ? Call to New Action

Enter Name as “Insert Order” Select Location. It can be either “At the end of the test” or “After the current step”.

Page 22: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 22 Exercise

SEED Infotech Ltd.

At the end of the test indicates an independent action After the current step indicates a dependent action.

Look at the Expert View to see the sequence of actions

It lists the actions you have created. Similarly do the above steps for logout functionality. 5. Then run the script, all the actions will be executed in the sequence in which you have inserted

Page 23: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 23 Exercise

SEED Infotech Ltd.

Lab 11 Assignment for making use of Call to Existing Action 1. Start QTP & open the new test File ? New ? Test A blank test opens 2. Click on Record button.

Automation ? record or click on record button. Record and Run settings Dialog box opens. Always select option for windows Application & Select option “Record and run test on any open Windows-based application”. Click on OK button. Login to the application and stop recording 3. Choose Edit ? Action ? Action Properties.

Change the Name to Login Click OK button Actions help to divide your test into logical units. With the help of Actions you can design more modular and efficient tests. Reusable action means you can call that action from any other test as per the requirement. 4. Go to Expert View and end of last line, do the following

5. You can call only those actions which are reusable. Call the action which is reusable that is Insert Order action. You will see Select Action screen.

Page 24: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 24 Exercise

SEED Infotech Ltd.

You will see only Reusable action in this list. Select appropriate Location .It can be either “At the end of the test” or “after the current step”.

6. Run this Test1 script.

Page 25: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 25 Exercise

SEED Infotech Ltd.

Lab 12 Assignment for making use of Call to Action. 1. Start QTP & open the new test File ? New ? Test A blank test opens 2. Click on Record button.

Automation ? record or click on record button. Record and Run settings Dialog box opens. Always select option for windows Application & Select option “Record and run test on any open Windows-based application”. Click on OK button. Login to the application and stop recording 3. Choose Edit ? Action ? Action Properties.

Change the Name to Login Click OK button Actions help to divide your test into logical units. With the help of Actions you can design more modular and efficient tests. Reusable action means you can call that action from any other test as per the requirement. 4. Go to Expert View and end of last line, do the following

Page 26: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 26 Exercise

SEED Infotech Ltd.

5. You can call only those actions which are reusable. Call the action which is reusable that is Insert Order action. You will see Select Action screen.

You will see only Reusable action in this list. Select appropriate Location You can edit this action as per your requirements

6. Run this Test1 script.

Page 27: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 27 Exercise

SEED Infotech Ltd.

Lab 13 Making use of per-action Mode 1. Per-action Mode is Default Mode for Learners/Beginners. 2. In this mode, Object repository is created for each Action. 3. If Single test have 10 actions, QTP will create 10 different Object Repository for each

action. This repository can be reused by multiple actions. 4. No need to save the repository explicitly.

Making use of shared Mode for Functions

1. Start QTP & open the new test File ? New ? Test A blank test opens 2. Click on Record button.

Automation ? record or click on record button. Record and Run settings Dialog box opens. Always select option for windows Application & Select option “Record and run test on any open Windows-based application”. Click on OK button. Steps on Application 3. Start Recording from Login Window till Insert Order and finally Log out. 4. Choose Resources ? Object Repository.

Page 28: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 28 Exercise

SEED Infotech Ltd.

5. Select File ? Export Local Objects in order to Export this Object Repository. Name its as “Order.tsr”

7. Save this file by clicking on “Save” button.

Page 29: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 29 Exercise

SEED Infotech Ltd.

6. Copy the script in notepad file and save it as “LoginInsert” and add respective function keywords

7. Create a new QTP Test as Test1. 8. In Test1, Choose File -> Settings -> Test Settings. Select Library file which is LoginInsert.vbs & Select the shared mode with object.tsr file.

9. Click on “OK” button. Then you have to call the functions as follows in the new test i.e. Test1 login() insertorder()

Public Function login() 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" Dialog("Login").WinEdit("Agent Name:").Set "seed" Dialog("Login").WinEdit("Password:").SetSecure "43859365bf86cd806326f1" Dialog("Login").WinButton("OK").Click Window("Flight Reservation").WaitProperty "visible", true, 10000 End function Public Function insertorder() Window("Flight Reservation").ActiveX("MaskEdBox").Type "1111111111" Window("Flight Reservation").WinComboBox("Fly From:").Select "Frankfurt" Window("Flight Reservation").WinComboBox("Fly To:").Select "London" Window("Flight Reservation").WinButton("FLIGHT").Click Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click Window("Flight Reservation").WinEdit("Name:").Set "leena" Window("Flight Reservation").WinButton("Insert Order").Click Window("Flight Reservation").ActiveX("Threed Panel").WaitProperty "text", "Insert Done...", 10000 Window("Flight Reservation").WinMenu("Menu").Select "File;Exit" End Function

Page 30: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 30 Exercise

SEED Infotech Ltd.

10. Now associate the object repository “Order.tsr” to the current action by selecting Resources ? Associate Object Repository You will see the below Window

11. Now choose “Order.tsr” and add in “Repository” frame. The Action names “Login and “Insert

Order” will be displayed in “Available Actions”. Use button to add it in “Associated Actions” Finally the window should look like this

11. Run the Test1 script.

Page 31: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 31 Exercise

SEED Infotech Ltd.

Lab 14 Regular Expression

1. Start QTP & open the new test File ? New ? Test A blank test opens 2. Click on Record button.

Automation ? record or click on record button. Record and Run settings Dialog box opens. Always select option for windows Application & Select option “Record and run test on any open Windows-based application”. Click on OK button.

Steps on Application 3. Record from Login, Insert Order and then select Fax order option from File menu.

Click on Send button. You will get the message Fax send successfully. 4. Stop recording. 5. Run the script. The script will run till Fax order correctly. But it can’t send this order as it’s Fax Order No will be one more than recorded. That is why we have to insert the regular expression in the script. 6. Choose Resources ? Object Repository Click on the Fax Order No and select “text”.

In edit value Constant part, you will get Fax Order No. 5 (whichever was there while recording (assume it was 5).

Page 32: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 32 Exercise

SEED Infotech Ltd.

Just click on this icon which after Constant part, You will get other Dialog for Constant value options.The window displays the constant value, Fax Order No. 5. Delete 5 & one space & put the * over there and check the checkbox for regular expression.

As soon as you check the checkbox for Regular expression, you will see the following prompt.

Click Yes button This will result in the value Fax order No.\.*

Run the test again.

Page 33: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 33 Exercise

SEED Infotech Ltd.

Lab 15 Use the recovery scenario Manager

Recovery manager is nothing but exception handler in QTP. Here we will take “Flight Reservations” alert window.

1. Create a New blank test. 2. Open the Flight application. And Record with wrong data of password and click OK

button 3. Stop Recording. 4. Parameterize the test in such a way that you have one invalid data and one valid data. 5. Now start Recovery manager wizard from Resources > Recovery Scenario Manager 6. Select “New scenario” and start wizard. As you said “Next” to first window, you will get

window “Select Trigger Event” 7. Here, select option, “Pop-up window”. Click on “Next”. 8. Run the wizard as per following figure specified.

Figure 1

Figure 1

Page 34: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 34 Exercise

SEED Infotech Ltd.

Figure 2

Figure 3

Figure 4 a

Page 35: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 35 Exercise

SEED Infotech Ltd.

Figure 5 b

Figure 6

Figure 7 Note - Make sure you have unchecked “Add another recovery operation

Page 36: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 36 Exercise

SEED Infotech Ltd.

Figure 8

Figure 9 a Note – Provide some name as “Scenario name”

Figure 10 b

Page 37: QTP Student Work Book - Amazon S3 · Now, in Login Window, enter username as “seed” and password as “ mercury”. On Flight Reservation window, use menu to close application

Page 37 Exercise

SEED Infotech Ltd.

Note – Make sure that “Add scenario to current test” is checked

Figure 11

Figure 12

9. At the end save the recovery scenario into your folder with “.qrs” file.

10 . Run the test