Poll: Have u understood the process?
You do not have permission to vote in this poll.
Yes
0%
0 0%
No
0%
0 0%
Total 0 vote(s) 0%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get err.description for each error encountered during run in a simple way????
#1
Not Solved
Hi all.....

Actually this is the code i use to retrieve each error description but this is tedious and lengthy process. Can any one help me to make this code simple and better... Finally i am capturing the output in xl file....Thanks in Advance.....

Thanks Praveen
Sad

Code:
"Script starts"

'On error resume next
'
'SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
'Dialog("Login").WinEdit("Agent Name:").Set "praveen"
'If Err.Number <> 0 Then
'ErrorNumber1 =" Error # " & CStr(Err.Number)
'ErrorDescription1 = Err.Description
'Err.Clear ' Clear the error.
'Status1="Failed"
'Else
'Status1="Passed"
'End if
'Dialog("Login").WinEdit("Agent Name:").Type  micTab
'If Err.Number <> 0 Then
'ErrorNumber2 =" Error # " & CStr(Err.Number)
'ErrorDescription2 = Err.Description
'Err.Clear ' Clear the error..
'Status2="Failed"
'Else
'Status2="Passed"
'End if
'Dialog("Flight Reservations").WinButton("OK").Click
'If Err.Number <> 0 Then
'ErrorNumber3 =" Error # " & CStr(Err.Number)
'ErrorDescription3 = Err.Description
'Err.Clear ' Clear the error.
'Status3="Failed"
'Else
'Status3="Passed"
'End if
'Dialog("Login").WinEdit("Password:").SetSecure "4d2c2fce3ff74d5db0e8587410ed8700fa1b0f49"
'If Err.Number <> 0 Then
'ErrorNumber4=" Error # " & CStr(Err.Number)
'ErrorDescription4 = Err.Description
'Err.Clear ' Clear the error.
'Status4="Failed"
'Else
'Status4="Passed"
'End if
'return=Dialog("Login").WinButton("OK").Check (CheckPoint("OK"))
'msgbox (return)
'If Err.Number <> 0 Then
'ErrorNumber11 =" Error # " & CStr(Err.Number)
'ErrorDescription11 = Err.Description
'Err.Clear ' Clear the error.
'Status11="Failed"
'Else
'Status11="Passed"
'End if
'Dialog("Flight Reservations").WinButton("OK").Click
'If Err.Number <> 0 Then
'ErrorNumber5 =" Error # " & CStr(Err.Number)
'ErrorDescription5 = Err.Description
'Err.Clear ' Clear the error.
'Status5="Failed"
'Else
'Status5="Passed"
'End if
'Dialog("Login").WinEdit("Password:").SetSecure "4d2c2fcdb0e8587410ed8700fa1b0f49"
'If Err.Number <> 0 Then
'ErrorNumber6 =" Error # " & CStr(Err.Number)
'ErrorDescription6 = Err.Description
'Err.Clear ' Clear the error.
'Status6="Failed"
'Else
'Status6="Passed"
'End if
'Dialog("Login").WinEdit("Password:").Type  micReturn
'If Err.Number <> 0 Then
'ErrorNumber7 =" Error # " & CStr(Err.Number)
'ErrorDescription7 = Err.Description
'Err.Clear ' Clear the error.
'Status7="Failed"
'Else
'Status7="Passed"
'End if
'Dialog("Login").WinEdit("Password:").SetSecure "4d2c2fce3ff74d5db0e8587410ed8700fa1b0f49"
'If Err.Number <> 0 Then
'ErrorNumber8 =" Error # " & CStr(Err.Number)
'ErrorDescription8 = Err.Description
'Err.Clear ' Clear the error.
'Status8="Failed"
'Else
'Status8="Passed"
'End if
'Dialog("Login").WinEdit("Password:").Type  micReturn
'If Err.Number <> 0 Then
'ErrorNumber9 =" Error # " & CStr(Err.Number)
'ErrorDescription9 = Err.Description
'Err.Clear ' Clear the error.
'Status9="Failed"
'Else
'Status9="Passed"
'End if
'Window("Flight Reservation").Close
''err.raise 1033
'If Err.Number <> 0 Then
'ErrorNumber10 =" Error # " & CStr(Err.Number)
'ErrorDescription10 = Err.Description
'Err.Clear ' Clear the error.
'Status10="Failed"
'Else
'Status10="Passed"
'End If
'
'
'
'dDate=Now()
'sTablePath=Datatable.Value("Table_Path",dtGlobalsheet)
'
'Call WriteResults(sTablePath,dDate,Status1, ErrorNumber1,ErrorDescription1)
'Call WriteResults(sTablePath,dDate,Status2, ErrorNumber2,ErrorDescription2)
'Call WriteResults(sTablePath,dDate,Status3, ErrorNumber3,ErrorDescription3)
'Call WriteResults(sTablePath,dDate,Status4, ErrorNumber4,ErrorDescription4)
'Call WriteResults(sTablePath,dDate,Status5, ErrorNumber5,ErrorDescription5)
'Call WriteResults(sTablePath,dDate,Status6, ErrorNumber6,ErrorDescription6)
'Call WriteResults(sTablePath,dDate,Status7, ErrorNumber7,ErrorDescription7)
'Call WriteResults(sTablePath,dDate,Status8, ErrorNumber8,ErrorDescription8)
'Call WriteResults(sTablePath,dDate,Status9, ErrorNumber9,ErrorDescription9)
'Call WriteResults(sTablePath,dDate,Status10, ErrorNumber10,ErrorDescription10)
'Call WriteResults(sTablePath,dDate,Status11, ErrorNumber11,ErrorDescription11)
'
'Public Function WriteResults(sTablePath, dDate, sStatus, sErrorNumber, sErrorDescription)
'                          
'                    Datatable.AddSheet "dResults"              
'                 Datatable.ImportSheet sTablePath, "dResults","dResults"        
'                      iRowCount = Datatable.GetSheet("dResults").GetRowCount  
'                             Datatable.GetSheet("dResults").setCurrentRow(iRowCount+1)  
'                                iParamCount = Datatable.GetSheet("dResults").GetParameterCount  
'                                            If iParamCount = 0 Then
'                                                           Datatable.GetSheet("dResults").AddParameter "Rec_Num",""    
'                                                             Datatable.GetSheet("dResults").AddParameter "Date_Time",""
'                                                                        Datatable.GetSheet("dResults").AddParameter "Status",""        
'                                                                               Datatable.GetSheet("dResults").AddParameter "ErrorNumber",""
'                                                                                            Datatable.GetSheet("dResults").AddParameter "Description",""
'            Datatable.ExportSheet "C:\Documents and Settings\prajee\Desktop\Log_Error.xls", "dResults"
'            End If
'                      Datatable("Rec_Num","dResults")=iRowCount+1
'                            Datatable("Date_Time","dResults") = dDate  
'                                Datatable("Status","dResults") = sStatus      
'                                    Datatable("ErrorNumber","dResults") = sErrorNumber    
'                                            Datatable("Description","dResults") = sErrorDescription      
'Datatable.ExportSheet "C:\Documents and Settings\prajee\Desktop\Log_Error.xls", "dResults"
'End Function
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Error while adding Object to Object repository at run time SaranKumarV 3 8,654 02-02-2015, 01:40 AM
Last Post: dubeyvin
  QTP Run Error MuruganMK 5 4,950 03-21-2012, 10:59 AM
Last Post: sshukla12
  Run time error in QTP 10.0 Kavitha.Nathan 0 2,713 01-25-2012, 01:53 AM
Last Post: Kavitha.Nathan
  Run the QTPTest script from the Quality Center then an error occurs shivakumar6g 8 12,771 03-04-2011, 11:52 AM
Last Post: shivakumar6g
  QTP and Powerbuilder - " General Run Error" in parametrization guttustand 2 4,095 11-21-2010, 07:29 PM
Last Post: sumanth.sqa

Forum Jump:


Users browsing this thread: 1 Guest(s)