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 to use QTP for Regration testing, plz tell as with short Example of login window? plz tell as....

2 Answers  


Mention the different actions types of qtp.

0 Answers  


how we will use output values in qtp? is there any possibulity by descriptive programming?

2 Answers  


How we test web based application by using QTP

0 Answers  


what is the exact testing process in qtp plz explin ?

2 Answers  






How to open an application through scripting?

11 Answers  


Plz Explain AUTOMATION REFERENCE MODEL?

0 Answers  


How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s.

0 Answers  


how to post xml data from QTP scripts to any application?

0 Answers  


How to capture text from image to word

2 Answers  


What are main panes available in qtp test browser?

0 Answers  


• Re –Engineering the regression testing from 0% to 60% automation. This has saved 4-mandays in every release. what doeas this statement means

2 Answers   Infosys,


Categories