Micro Focus QTP (UFT) Forums
how to export test results into html file - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: how to export test results into html file (/Thread-how-to-export-test-results-into-html-file)



how to export test results into html file - Ishul - 04-08-2012

Hi all,
i want to know how to export the test scripts results into the html file,
In automation frame work

i have created, main folder - QTPFW

in that i have subfolder -Testscrpts, SOR,Library and Results folders

Result folder contains excel file - which holds just the test name and result -pass or fail thats it, but i want to know how to embed the html result file into qtp.



Thanks in advance


RE: how to export test results into html file - zoharelias - 04-10-2012

Maybe this would help:
(the xml file is the results.xml. the xsl file is the PShort.xsl in the Run Results Viewer folder)

Code:
Set fso = CreateObject("Scripting.FileSystemObject")
Set xml = CreateObject ("Microsoft.XMLDOM")
xml.async = false
xml.load(xmlfile)

Set xsl = CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(xslFile)

S = xml.transformNode(xsl.documentElement)

Set CreateFile = fso.CreateTextFile(htmlfile)

CreateFile.WriteLine(S)
CreateFile.Close