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):

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

More WinRunner Interview Questions

what is Retesting and what is the difference between Retesting and Regression testing?

7 Answers   Accenture, Infeneon Technologies,


What is context sensitive Recording?

7 Answers   Second Foundation,


The GUI MAp Editor or Rapid Fire test are not learning the GUI of any window or any object..The pointer conevrts to hand and everthing hangs till i don't press Ctrl+Alt+Del. Help me!!!

1 Answers  


Name the different types of checkpoints?

0 Answers  


What is the definition of function?

1 Answers  


What is the Winrunner Framework in your organisation?

1 Answers   CA, TCS, Valtech,


Could you anyone share me the path to download the automation tools which are having trial license version?

0 Answers  


What is the Difference between the versions of WinRunner7.1 and WinRunner7.6? What r the advantages of WR7.6 than WR 7.1 and Which type of Browsers they support?

1 Answers   Scandent,


How will you review the test case and how many types are there ?

4 Answers   AppLabs,


which option in WR executes the script line by line

3 Answers  


How do you run your test scripts?

1 Answers  


what is the syntax for regular expression.dont send the types like regexp_label,regexp_msw_class

1 Answers   QA,


Categories