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

Does QTP record on Objects created on XWindows Environment?

0 Answers   Infotech,


What type of VB script u had done in expert view?

1 Answers  


can any one explain with an example how to test Web application using qtp

3 Answers  


Why do you create a text checkpoint on a Web application? What is the purpose of the Close method?

0 Answers  


In qtp is it possible to check broken links of a page?

0 Answers  


Hi, this is venkatesh. Q: I have 10 files in a folder(say D:\). Out of which there are some .txt, .xls, .doc. I want to know how to get the count of each file using qtp? If U have any ans, plz write script for that...

4 Answers   EDS,


if numbers are always changing write a script for that

1 Answers   Nous,


1. Pls can anyone give me the descriptive programing script to find the number of edit boxes in a login window in flights reservation (windows application only not web). 2. Using descriptive programing, how do you handle changing URLs. Pls anyone, very urgent

2 Answers   Infotech,


Hi Small doubt . i am working as Contract employee in XYZ comany thrw ABC Consultancy. so. How i write my resume ? In Professional experience Column. plz send urgent

2 Answers  


can any body help me out by providing links/material for descriptive programming in QTP otherwise can you post decriptive programing based interview Questetion&ans. plz help me out . i need it.

1 Answers   ADP,


How cookies can be tested in QTP?

2 Answers   Deloitte, TCS,


Give me Example for Generic Functions in QTP Framework....Anybody please answer me..Thanks in Advance

3 Answers   BirlaSoft,


Categories