How to handle exceptions in for loop of DDT script.

Answer Posted / 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):

Steps:
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
exception.

DataTable xl sheet in qtp take the data like this:
UserName
--------
Mercury
mercu

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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of regexp_msw_class property?

910


What is the purpose of a gui spy?

955


How you integrated your automated scripts from TestDirector?

868


What is toogle breakpoints? How does it differ from break points?

2084


Have you used winrunner in your project?

819


What are the synchronization points?

889


How do you handle dynamically changing area of the window in the bitmap checkpoints?

846


How should we write and execute a user define function using WinRunner.

1886


What is the difference between writing a function and writing a script?

1056


What is the purpose of different record methods 1) record 2) pass up 3) as object 4) ignore.

875


i this is priya speaking, any 1 tell me project detail for NETBANKING and HELTHCARE pls send to this E-MAIL ADDRESS; (priyadharshni2@yahoo.com)pls qik, thank u once agajn.

1843


when start testing

2415


How do you select multiple objects during merging the files?

931


Hi iam a begginer or rather new stsrter to QTP and strugling to start as i have to start writing the automated scripts for the existing manual testing could some one send me some tips ans tricks for a jump start. Any help is greatly appreciated

2100


How to integrate automated scripts from testdirector to winrunner scripts?

939