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
How are actions and functions different in QTP?
Hi How to retrieve data from web element line by line?
what is profile tool?
How to test login module with different username and password by using data driven testing in QTP?
hi in real time who will execute the qtp test scripts? my faculty said, in a companty automation testers are written the test scripts and manual testers are execute the test scripts...IS IT RIGHT OR NOT?
What is Curd testing?
Can we create a qtp test from qc?
Discuss the QTP Environment?
How does qtp identify objects in the application?
What is the difference between rational rose and QTP?
How many types of recording modes in the qtp?
Is there anyway to automatically update the Datasource name in Database Checkpoints object when we migrate tests to a new release?
Have you used xml check point in your project? How?
Dear All, How to generate Pass or Fail Report in QTP without using Reporter.Report Event Method ? Thanks Balaji
Explain how you can replace string in qtp?