There can be 2 possible solutions may be others can also give suggestion :

1) Writing a wrapper function like below which handles possible error
scenario and carries of an action or returns back a message :
Public Function UdfButtonClick(objName)
  ' Check if the objName exists
  If objName.Exist Then
       If objName.GetROProperty("disabled") = False Then
           objName.Click
           UdfButtonClick = UDTRUE
      Else
          UdsLogMsg "UdfButtonClick() WebButton Object ["&
objName.GetROProperty("name") &"] is DISABLED "
         UdfButtonClick = OBJ_DISABLED
     End If
Else
      UdsLogMsg "UdfButtonClick() WebButton Object DOES NOT EXIST "
     UdfButtonClick = OBJ_NOT_FOUND
End If
End Function

2) Another solution is err.number which will hv a value greater than > 0
whenever an error occurs. Capture the description as below :

If err.number>0 then
          msgbox err.description
End if


On Fri, Feb 12, 2010 at 10:59 AM, Kiran Ogeti <[email protected]> wrote:

>
> Has anyone tried reporting the errors in data table results , regardless
> whatever the error comes in ?
>
> Lets say SAVE button disabled on application >> so you get Object disabled
> error message when you run the script
>
> How do I capture these kind of errors to data table .. I guess there is a
> simple mechanism doing this rather than coding for each and everybutton on
> the applicaiton...any idea??
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<mercuryqtp%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en




-- 
Ganesh Muralidharan

'God Never Forgets'

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to