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

how can we know the program is testing by multiple test data in data driven frame work?

1 Answers   CTS,


What is the use of Testing framework in Automated testing..what are different kinds of Testing frameworks available in Automated testing...

1 Answers   IBM,


Other than using import sheet statement for importing the data from excel sheet, is there any other method that can be used?

2 Answers  


How to import excel sheet to QC?

1 Answers  


What is difference between QC and TD?

8 Answers  






i need qtp tutorial. pls send it to sridhar.k151@g mail.com

0 Answers  


What is Version control?

3 Answers  


What is the new version of qtp which is recently released in the market?

0 Answers  


i can done the project with QTP in that time i can say how many members in my team size?

0 Answers  


Hybrid framework supports Descriptive programming. Is it true?

0 Answers  


using descriptive programming how to close all opend browsers?

7 Answers   Satyam,


What is QuickTest Automation Object Model? Where we can use AOM?

1 Answers  


Categories