Hi all,
I know qtp has error handling functions like,
On error resume Next
On error goto 0
On error raise errornumber
All these are adapted from vbscript. but one of that is missing which
is
On error goto stepname
Because of this we couldnt handle inline error. Even if we use
On Error resume next , that is going to pass all the steps that fails
and i will get only the final step error.
example:
function calculate()
on error resume next
x=10/0
y=20/0
z=40/0
if err.number <> 0 then
msgbox err.number
msgbox err.description
on error goto 0
endif
But in this case i will get only the last error description and error
number. I want to quit on first error and get the correspoinding
error number and description. That will be possible only if qtp has
the feature On error goto errorhandling.
See below example
function calculate()
on error goto errorhandling
x=10/0
y=20/0
z=40/0
errorhandling:
if err.number <> 0 then
msgbox err.number
msgbox err.description
on error goto 0
endif
Let me know if there is a workaround for this?
thanks
--------------------
1. LR 9.5
2. HTTP/HTML
3. Yes
4. - Concurrent groups,
5. FP4
6. New recording
7. Permanent http/html 5000
8. Permanent
9. Windows-XP, SP2
10. Not filed