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

how can you explain your Real Estate Project in front of interviewer..? please step by step......

1381


What do you mean by the logical name of the object.

864


Name the two modes of recording?

819


Which are default codes winrunner generates when we start the application?

1838


What is the XML test cases creation?

2457


What actually happens when you load GUI map?

1023


what is qtp licence

1814


two file is there how will compate it by useing qtp.

1969


What is the purpose of gui spy?

1040


How do you configure gui map?

923


What are the Win Runner tools for functional testing?

2768


How do you find out which is the start up file in winrunner?

851


How to check the background colour of the screen in WR?

1720


descriptive program for web application.

1755


What is the disadvantage of loading the GUI maps through start up scripts?

824