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..??

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How the smart identification is used in real time?Please explain with an example

1762


What is qtpro? What is quick test pro? What is a quick test professional?

787


How to handle the exceptions using recovery secnario manager in quicktest professional?

856


What is synchronization point in QTP?

842


Can anyone share/send me QTP 8.2 Crack as I had it before but now it's virus affected. Pls send me on Sawale.vijay@gmail.com Thanks, ~Vijay

2836






why you have standardized functions? plzzz guys with real time exp. do answer

1610


1.How to record ,capture and also script to capture the close buttons. 2.How to record ,capture and also script to capture the options ---File ->save and File ->close in a browser and PDF files. 3.How to compare the Excel sheet values in a report using QTP scripting. 4.How to compare 2 PDf reports using QTP scripts as well reording. 5.How to compare 2 Excel reports using QTP scripts as well reording. 6.How to save a PDF report to a folder and then translate the report to an Excel type of report and compare that Excel Report with an other excel report. Please clarify me

1803


Client is able to provide budget..he want you to choose the automation tool for the web application? which one you will select ? QTP or Selenium ? what are the reasons?

1460


What is test object model in quicktest professional?

794


i want information about API testing and i want info like how process can be done in company? i want added info like coding ,debugging, desing in c.v ? what should add in c.v for eg banking domin? pls any answer my question?

1766


Define Environment Variable in UFT and its uses?

783


assume i have few url link how will i dynamically call then using descriptive programming?

1772


How did you use regular expressions in QTP and also in WR?

2360


how can i call function (which has link with excell sheet at a remote location) within another function

1756


Why bpt?

791