Reporting the errors in data table results

Let’s say SAVE button disabled on application, so you get Object disabled error message when you run the script.

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 have a value greater than > 0
whenever an error occurs. Capture the description as below :

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

Leave a Reply