|
Dim nodelocation 'locate the node of xxxx_TestCasexxxx
Dim testcase 'testcasename
Dim details 'details
Dim status 'status
nodelocation=1
Function getXMLData(spriptname,qtpreport)
Dim j
Err.Clear
Set dom=CreateObject("microsoft.xmldom")
Set p=New RegExp
dom.load qtpreport
p.Pattern=spriptname&"_TestCase[0-99999]"
Do While 1
On Error Resume Next
nodetext=dom.getElementsByTagName("Obj")(nodelocation).text
If Err.Number=424 Then
Exit do
End If
If p.Test(nodetext)=True Then
j=nodelocation
Exit do
End If
nodelocation=nodelocation+1
Loop
If Err.Number<>424 Then
testcase=dom.getElementsByTagName("Obj")(j).text
details=dom.getElementsByTagName("Obj")(j).nextSibling.text
status=dom.getElementsByTagName("Obj")(j).nextSibling.nextSibling.nextSibling.getAttribute("status")
nodelocation=j+1
MsgBox testcase
MsgBox details
MsgBox status
End If
End Function
Call getXMLData("Application","E:\qtpscript\FWTestProject\report\SDK_AppLication\20081104142522\Report\Results.xml") |
|