Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic error handling
#2
Solved: 10 Years, 11 Months, 2 Weeks ago
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.
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.
Reply


Messages In This Thread
Basic error handling - by RandomGrin - 10-10-2013, 11:16 PM
RE: Basic error handling - by basanth27 - 10-11-2013, 10:11 AM
RE: Basic error handling - by RandomGrin - 10-11-2013, 07:52 PM
RE: Basic error handling - by basanth27 - 10-12-2013, 07:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Estimate for preparing a basic test script QTPBeginner48 4 3,004 02-25-2014, 03:45 PM
Last Post: guin.anirban
  Flight reservation basic parameterization not working on qtp 11.5 srs246 0 3,735 01-08-2013, 10:14 AM
Last Post: srs246
  3 basic questions..please help Blizna 5 5,110 07-09-2010, 12:21 PM
Last Post: sasmitakumari
  Visual Basic Application Recording dlopes 2 2,553 07-09-2010, 10:21 AM
Last Post: Saket
  What is the errors handling ? keni 1 2,601 10-26-2009, 09:47 AM
Last Post: Saket

Forum Jump:


Users browsing this thread: 3 Guest(s)