The below code writes pass or fail status for a particular test case in the excel sheet.
The procedure takes 3 parameters.
shname is sheet name
tid is the test case id mentioned in the first column of the excel sheet
res is the result. it can be "pass" or "fail"
This result will be placed in the 5th column as the template will be (Testcase id, test case title, description, test data,Result)
If the test cases are more than 3000, change the value in the for loop
Public sub report_result(shname,tid,res)
Set oexcel = CreateObject("Excel.Application")
Set obook = oexcel.Workbooks.Open("c:\TF_Automation\Results\TF_TestScripts.xls")
obook.Sheets(shname).select
' oexcel.Visible=true
For i=1 to 3000
if tid=oexcel.Cells(i,1).value Then
oexcel.Cells(i,5)=res
Exit for
End If
Next
obook.Save
obook.Close
End Sub
The procedure takes 3 parameters.
shname is sheet name
tid is the test case id mentioned in the first column of the excel sheet
res is the result. it can be "pass" or "fail"
This result will be placed in the 5th column as the template will be (Testcase id, test case title, description, test data,Result)
If the test cases are more than 3000, change the value in the for loop
Public sub report_result(shname,tid,res)
Set oexcel = CreateObject("Excel.Application")
Set obook = oexcel.Workbooks.Open("c:\TF_Automation\Results\TF_TestScripts.xls")
obook.Sheets(shname).select
' oexcel.Visible=true
For i=1 to 3000
if tid=oexcel.Cells(i,1).value Then
oexcel.Cells(i,5)=res
Exit for
End If
Next
obook.Save
obook.Close
End Sub