When we use 'ERR' object to handle the exceptions in the
script, do we need to include any statement in the
beginning of the script..??

Answers were Sorted based on User's Feedback



When we use 'ERR' object to handle the exceptions in the script, do we need to include a..

Answer / uday kumar _ anem

Generally, when QTP encounters a run time error during
running the scripts, it shows the error message in a pop up
window and the script execution will stops.

If you wish to display your own error message and you wish
to continue with the script, then we will use Err object.

We have to use "On Error Resume Next" statement before the
runtime error is returned.

The general usage of the Err object is like:

On Error Resume Next

dim fileSysObj
fileSysObj=createobject("Scripting.FileSystemObject")

fileSysObj.folderexists("c:\uday") 'assume this folder
doesnt exist
'QTP shows the error message here itself and stops
execution, if "On Error Resume Next" statement doesnt exists


If Err.Number <>0 then
msgbox("Here it prints") 'Because of Err object we can give
our own error message
end if

Is This Answer Correct ?    1 Yes 1 No

When we use 'ERR' object to handle the exceptions in the script, do we need to include a..

Answer / nath t

Yes u have to mention "On Error Resume Next" statement in
the beginning of the script

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More QTP Interview Questions

In qtp, explain what is crypt object

0 Answers  


How to check the value for variables during run time. Pls anybody can give the answer.. Thanks in advance...

4 Answers   Navis,


Is there any option in QTP to add Java add-in after instaling the QTP?

3 Answers   IBM,


what is debugging testing?

5 Answers  


The structure of keyword driven frame work is like a folder structure the different sub folder are 1-functional libray folder 2-object repository folder 3- database folder 4-appliction1.xls 5-initalzation vbs file 6-sequence file 7-driver script 8-test case list file My question is whether these are in a local server machine or in our pc.((whether It like Vss). can u give example of driver script(code)

0 Answers   TCS,






For which type of project the iterative model is suitable?

0 Answers  


what is bultin funtaion in QTP &tell me five examples?

5 Answers   Kanbay,


How can the expected image for a bitmap checkpoint be recaptured in QTP

2 Answers   Ordain Solutions,


what are the principles of good testing scripts for automation?

1 Answers  


How to remove the associated function library?

0 Answers  


I want two test two agents login for the flight website. Here is the scenario: I want to go through 1-3 rows for one user login and other user login I want to go though 3-5 rows. How would you set this up in qtp. Thank You

0 Answers   IBM,


Explain the QTP Tool interface.

2 Answers   Crea,


Categories