Set objExcel = CreateObject("Excel.Application") Set objWorkbook = objExcel.Workbooks.Open("C:\Users\Toshiba\ankit\Book1.xlsx")
intRow = 1
Do Until objExcel.Cells(intRow,1).Value = ""
a = objExcel.Cells(intRow, 1).Value b = objExcel.Cells(intRow, 2).Value c = objExcel.Cells(intRow, 3).Value d= objExcel.Cells(intRow, 4).Value e = objExcel.Cells(intRow, 5).Value 'value of second and third parameter in updagelog need to be set post processing of tescase Call updateLog(myLocation,"Page:Last login container is present","pass", "" & a & "" , "" & b & "","" & c & "","" & d & "","" & e & "")
intRow = intRow 1
Loop
objExcel.Quit Call appendToTextFile(sFile, sText)
Function ToTextFile(myLocation)
Set FSO = CreateObject("Scripting.FileSystemObject") Set oFile = FSO.CreateTextFile(myLocation, True) set FSO=nothing set oFile=nothing End Function
Function ToTextFile1(sFile)
Set FSO = CreateObject("Scripting.FileSystemObject") Set oFile = FSO.CreateTextFile(sFile, True) Set FSO=nothing set oFile=nothing End Function
Function appendToTextFile(sFile, sText)
Set FSO1 = CreateObject("Scripting.FileSystemObject") Set oFile1 = FSO1.OpenTextFile(sFile, 8, true) oFile1.WriteLine (sText) oFile1.Close Set FSO = nothing Set FSO1 = nothing Set oFile = nothing Set oFile1 = nothing Set FSO2 = nothing Set oFile2 = nothing End Function
Function addHeader(myLocation) appendToTextFile myLocation, "<Table Border = 1><TR><TD WIDTH = 40>myCaseId</TD><TD WIDTH = 20>testcase name</TD><TD WIDTH = 40>stepstobe performed</TD><TD WIDTH = 40>expectedresult</TD><TD WIDTH = 40>actual result header</TD><TD WIDTH = 40>Log</TD><TD WIDTH = 40>Status</TD></TR></Table>" End Function
Function updateLog (myLocation, myLog, myStatus,myCaseId,myCaseName,myStep,myExpRes,myActRes) Dim myPass Dim myFail myPass = "<font color = green> PASSED <font color = black>" myFail = "<font color = red> FAILED <font color = black>"
myVerify = "<font color = green> PASSED <font color = black>"
This conversation is currently closed to new comments.
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
writing to html file.
'mylog="testddhbf"
'mystatus="pass"
sFile="C:\Users\Toshiba\ankit\log.txt"
Call ToTextFile(myLocation)
Call ToTextFile1(sFile)
Call addHeader(myLocation)
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Users\Toshiba\ankit\Book1.xlsx")
intRow = 1
Do Until objExcel.Cells(intRow,1).Value = ""
a = objExcel.Cells(intRow, 1).Value
b = objExcel.Cells(intRow, 2).Value
c = objExcel.Cells(intRow, 3).Value
d= objExcel.Cells(intRow, 4).Value
e = objExcel.Cells(intRow, 5).Value
'value of second and third parameter in updagelog need to be set post processing of tescase
Call updateLog(myLocation,"Page:Last login container is present","pass", "" & a & "" , "" & b & "","" & c & "","" & d & "","" & e & "")
intRow = intRow 1
Loop
objExcel.Quit
Call appendToTextFile(sFile, sText)
Function ToTextFile(myLocation)
Set FSO = CreateObject("Scripting.FileSystemObject")
Set oFile = FSO.CreateTextFile(myLocation, True)
set FSO=nothing
set oFile=nothing
End Function
Function ToTextFile1(sFile)
Set FSO = CreateObject("Scripting.FileSystemObject")
Set oFile = FSO.CreateTextFile(sFile, True)
Set FSO=nothing
set oFile=nothing
End Function
Function appendToTextFile(sFile, sText)
Set FSO1 = CreateObject("Scripting.FileSystemObject")
Set oFile1 = FSO1.OpenTextFile(sFile, 8, true)
oFile1.WriteLine (sText)
oFile1.Close
Set FSO = nothing
Set FSO1 = nothing
Set oFile = nothing
Set oFile1 = nothing
Set FSO2 = nothing
Set oFile2 = nothing
End Function
Function addHeader(myLocation)
appendToTextFile myLocation, "<Table Border = 1><TR><TD WIDTH = 40>myCaseId</TD><TD WIDTH = 20>testcase name</TD><TD WIDTH = 40>stepstobe performed</TD><TD WIDTH = 40>expectedresult</TD><TD WIDTH = 40>actual result header</TD><TD WIDTH = 40>Log</TD><TD WIDTH = 40>Status</TD></TR></Table>"
End Function
Function updateLog (myLocation, myLog, myStatus,myCaseId,myCaseName,myStep,myExpRes,myActRes)
Dim myPass
Dim myFail
myPass = "<font color = green> PASSED <font color = black>"
myFail = "<font color = red> FAILED <font color = black>"
myVerify = "<font color = green> PASSED <font color = black>"