01-13-2011, 04:30 PM
(This post was last modified: 01-13-2011, 04:41 PM by pravinsibi.)
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
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
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