How to handle exceptions in for loop of DDT script.

How to handle exceptions in for loop of DDT script...

Answer / maheshqtp

Steps for handle the Exceptions:
1 ways is: Object Repository based Exceptions
2 way is: Descriptive based(VB Script)Exceptions

OR based Exceptions(using tool options):

1. Take the +ve & -ve Test Data in Data Table
2. when ever the -ve data enter on the application at that
time that application was shows the error. Capture this
error window using recovery scenario concept in QTP
Ex: In the Flight Application User Name was accept
only Mercury. If u enter the any other than that at that
time the Flight application was shows error message (ie.
popup window: Enter Valid Password). We need handle this

DataTable xl sheet in qtp take the data like this:

Resources --> Recovery Scenario Manager --> Click on the +
Sumbol --> Select the Pop up window option --> With the hand
icon select the Error Windows: Tittle Name that window name
appears in the text box --> click next and again with hand
icon click the on the error msg which was displayed on the
error window.--> click next
give the scenarion name
give the recovery scenario file name.

Generate the DDT script for execute the Test Data.
Output: now handle the -ve test data.

Descriptive based Exceptions(without qtp tool options):

Use here .exist method for exist that window
.GetROProperty to capture the error message.

If Dialog("Flight Applications").Exist Then
errmsg=Dialog("Flight Applications").GetROProperty("text")
If errmsg = "Enter Valid UserName" Then
Dialog("Flight Applications").WinButton("OK").Click
End If
End If

Like this we can develop the VbScript code without using the
tool options.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More WinRunner Interview Questions

what is add-in manager in WinRunner?

2 Answers  

How winrunner Handles varying window Labels?

2 Answers   FCG,

how you execute the function

1 Answers   Polaris,

what is meant by build release note?what it contains?

4 Answers   CTS,

How to check the Back Ground Color of screen in Winrunner?

3 Answers   3i Infotech, Satyam,

What is the default type of constant TSL supports?

1 Answers  

can anybody give me example of 5 critical,major,& low severity and priority bug

0 Answers  

What is the use of gui map?

0 Answers  

what is the purpose of verify,update and debug modes in wr?

3 Answers   Accenture,

is 'Vendor' is a Reserved in WinRunner or not?

1 Answers   FCG,

What is the purpose of the temp GUI map file?

0 Answers  

How do you run your test scripts?

1 Answers