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
Whats the realtime QTP testing process
Hi, How Accessibility checkpoint in QTP can be implemented in the test script?
How qtp recognizes the object?
What is quicktest professional window?
Hello Everyone, Please provide me the practical example of business component concept of QTP.Like how to create business component,how to connect the quality center etc.... Thanks in advance, Gaytri
How to find the length of the string in qtp?
What is use of object spy?
Hi we are running tests remotely from quality center and pushing tests into qtp boxes remotely, and it does execution but while uploading results back into quality center it hangs in qtp box.If any one come across similar problem, please send me details how to handle this. Thanks kris
How to analyzing test results using quicktest professional?
I recorded a Web App with a Oracle backend using QTP 9.5 and for some reason the scripts don't play back> What am I missing at this point. I recorded the same Apps under Sybase and they work great. This is Oracle 10g. Why won't my scripts play back.
How you create new action in qtp?
How to analyzing test results using quicktest professional (qtp)?
Explain the features and benefits of quick test pro(qtp)?
Hi, i run scripts in one machine those r passed.when i run the scripts in client side those r failed.Give me such a scenario when ever u faced?
How to carry out bit map check points in QTP