Forum Discussion
The code didn't originate with me so I'm just guessing...
BUT... resfile, as I read the code, is the FQN of the output file for the html report. e.g., C:\\reportfiles\\myreport.html. Obviously, you want to do things a LITTLE bit smarter like build the file name based upon date and time for the report output... but hopefully you get the idea.
As for value, I believe that is specifically the text that you want to be added as a record to the table. Now, you can add that text specifically and explicitly yourself OR you could write code to parse out the native log file and dump that to your HTML. Either way, value is your ACTUAL result text you want to show up in the file.
That's my best guess, at least...
Keep in mind, also, that the code you pasted is VBScript so you'll have to do the necessary syntax changes for it to be formatted for Python.
tristaanogre thanks for the info
if am not wrong this how in python the code looks like
def PageHeader(resfile): aqFile.WriteToTextFile(resfile, "<html>", aqFile.ctUnicode) aqFile.WriteToTextFile(resfile, "<head>", aqFile.ctUnicode) aqFile.WriteToTextFile(resfile, "<title> Automation Results </title>", aqFile.ctUnicode) aqFile.WriteToTextFile(resfile, "</head>", aqFile.ctUnicode) aqFile.WriteToTextFile(resfile, "<body>", aqFile.ctUnicode) aqFile.WriteToTextFile(resfile, "<table width=90% border=2 bordercolor=" & "#000000 id=table1 bordercolorlight=" & "#000000>", aqFile.ctUnicode) return def AddHtml_Results(resfile,Value): aqFile.WriteToTextFile(resfile, "<tr>", aqFile.ctUnicode) aqFile.WriteToTextFile(resfile, "<td width=80% bgcolor = #000000 >", aqFile.ctUnicode) aqFile.WriteToTextFile(resfile, value, aqFile.ctUnicode) aqFile.WriteToTextFile(resfile, "</td>", aqFile.ctUnicode) aqFile.WriteToTextFile(resfile, "</tr>", aqFile.ctUnicode) aqFile.WriteToTextFile(resfile, "</table>", aqFile.ctUnicode) return def PageFooter(resFile): aqFile.WriteToTextFile(resfile, "</body>", aqFile.ctUnicode) aqFile.WriteToTextFile(resfile, "</html>", aqFile.ctUnicode) return
Do i Need to maintain all those header then middle of html and footer separately cant we merge all the 3 things into single function.