Hi,
The below code will convert XML QTP Results to HTML file.
Function ConvertToHTML(sResultPath)
'sResultPath = "C:\DOCUME~1\user\LOCALS~1\Temp\TempResults\"
sProductDir = "C:\Program Files\HP\QuickTest Professional\dat\"
Const ForWriting = 2
Set xmlSource = CreateObject("MSXML.DOMDocument")
Set xmlXForm = CreateObject("MSXML.DOMDocument")
xmlSource.validateOnParse = True
xmlXForm.validateOnParse = True
xmlSource.async = False
xmlXForm.async = False
xmlSource.Load sResultPath & "Report\Results.xml"
xmlXForm.Load sProductDir & "PShort.xsl" 'if you want more details, then
you can use PDetails.xsl
Set fso = CreateObject("Scripting.FileSystemObject")
sHTMLPath = Replace(sResultPath & "Report\Results.xml", ".xml", ".html")
Set file = fso.OpenTextFile(sHTMLPath, ForWriting, True)
file.write xmlSource.transformNode(xmlXForm)
file.Close
fso.CopyFile sProductDir & "PResults.css", sResultPath & "Report\"
ExportResultHTML = sHTMLPath
Set file = Nothing
Set fso = Nothing
Set xmlXForm = Nothing
Set xmlSource = Nothing
End Function
--
With Regards,
Johnson Solomon
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en