Public objfso
Dim ResultFolder:ResultFolder="C:\Users\config\Desktop\UFT\"
Set objfso=Createobject("Scripting.FileSystemObject")
If NOT objfso.FolderExists(ResultFolder) then
Msgbox "Folder Does Not Exist. Proceeding with creation"
objfso.CreateFolder(ResultFolder)
End If
Filename=ResultFolder&Environment.Value("TestName")&".html"
Print Filename
Set Logfile=objfso.CreateTextFile(ResultFolder&Environment.Value("TestName")&".html")
Logfile.Close()
Call InitiateLog()
Call WriteLog("PASS","teststep","stepdesc")
Call WriteLog("Fail","teststep2","stepdesc2")
Call Completelog()
Function InitiateLog()
Set ofile=objfso.OpenTextFile(Filename,8)
ofile.WriteLine("<table border=1 cellspacing=1 > <tr>")
ofile.WriteLine("<th>Status</th>")
ofile.WriteLine("<th>Stepname</th>")
ofile.WriteLine("<th>stepDescription</th>")
'link=<a href='"https://www.w3schools.com">Visit W3Schools.com!</a>
' ofile.WriteLine("<td>&link</td>")
ofile.WriteLine ("</tr>")
ofile.Close
End Function
Function WriteLog(strStatus,Stepname,stepDescription)
Set ofile=objfso.OpenTextFile(Filename,8)
ofile.WriteLine("<tr>")
ofile.WriteLine("<td>"&strStatus&"</td>")
ofile.WriteLine("<td>"&Stepname&"</td>")
ofile.WriteLine("<td>"&stepDescription&"</td>")
'link=<a href='"https://www.w3schools.com">Visit W3Schools.com!</a>
' ofile.WriteLine("<td>&link</td>")
ofile.WriteLine ("</tr>")
ofile.Close
End Function
Function Completelog()
Set ofile=objfso.OpenTextFile(Filename,8)
ofile.WriteLine("</table>")
ofile.Close
End Function
Dim ResultFolder:ResultFolder="C:\Users\config\Desktop\UFT\"
Set objfso=Createobject("Scripting.FileSystemObject")
If NOT objfso.FolderExists(ResultFolder) then
Msgbox "Folder Does Not Exist. Proceeding with creation"
objfso.CreateFolder(ResultFolder)
End If
Filename=ResultFolder&Environment.Value("TestName")&".html"
Print Filename
Set Logfile=objfso.CreateTextFile(ResultFolder&Environment.Value("TestName")&".html")
Logfile.Close()
Call InitiateLog()
Call WriteLog("PASS","teststep","stepdesc")
Call WriteLog("Fail","teststep2","stepdesc2")
Call Completelog()
Function InitiateLog()
Set ofile=objfso.OpenTextFile(Filename,8)
ofile.WriteLine("<table border=1 cellspacing=1 > <tr>")
ofile.WriteLine("<th>Status</th>")
ofile.WriteLine("<th>Stepname</th>")
ofile.WriteLine("<th>stepDescription</th>")
'link=<a href='"https://www.w3schools.com">Visit W3Schools.com!</a>
' ofile.WriteLine("<td>&link</td>")
ofile.WriteLine ("</tr>")
ofile.Close
End Function
Function WriteLog(strStatus,Stepname,stepDescription)
Set ofile=objfso.OpenTextFile(Filename,8)
ofile.WriteLine("<tr>")
ofile.WriteLine("<td>"&strStatus&"</td>")
ofile.WriteLine("<td>"&Stepname&"</td>")
ofile.WriteLine("<td>"&stepDescription&"</td>")
'link=<a href='"https://www.w3schools.com">Visit W3Schools.com!</a>
' ofile.WriteLine("<td>&link</td>")
ofile.WriteLine ("</tr>")
ofile.Close
End Function
Function Completelog()
Set ofile=objfso.OpenTextFile(Filename,8)
ofile.WriteLine("</table>")
ofile.Close
End Function