10-11-2013, 10:11 AM
Hey Mark,
Very informative research. Yes, I understand your pain. I am working on Continous Integration the NextGen in Test Automation and the criteria for automation is to execute without a break. To Do that we need to have exemplary error handlers and I am not even Close :-)
However, I can share what I have learnt. I think one of the best usage of functions is to individually handle each action. Here is a crude way of how it could be done, I would encourage you to enhance and script it according to your needs.
Very informative research. Yes, I understand your pain. I am working on Continous Integration the NextGen in Test Automation and the criteria for automation is to execute without a break. To Do that we need to have exemplary error handlers and I am not even Close :-)
However, I can share what I have learnt. I think one of the best usage of functions is to individually handle each action. Here is a crude way of how it could be done, I would encourage you to enhance and script it according to your needs.
Code:
Public Function oWebList_SelectVal(WebListObj, Val2)
RetVal = -1
On Error Resume Next
' you code here...
.....
.....
If Err.Number <> 0 then
Msgbox "Fail"
Exit Function
End If
RetVal = 0
End Function
Public Function SelectDialog_WebList(Obj)
RetVal = -1
On Error Resume Next
If Obj.Exists And Obj.Enabled Then
Call oWebList_SelectVal(Obj, Val2)
Else
'Log the error
End If
If Err.Number <> 0 then
'''Log Fail
Exit Function
End If
RetVal = 0
End Function
' ' ' On your main Code
Set WebListObj = Browser().Page().Weblist()
intRet = SelectDialog_WebList(WebListObj)
If intRet <> 0 Then
' ' ' Log Error
End if
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.