Hi try this function
Dim description, filepath
Set xmlDoc1 = CreateObject(“Msxml2.DOMDocument”)
xmlDoc1.load(“C:\1.xml”)’file 1
Set xmlDoc2 = CreateObject(“Msxml2.DOMDocument”)
xmlDoc2.load(“C:\2.xmll”)’file 2
Set ElemList1= xmlDoc1.DocumentElement.ChildNodes
Set ElemList2= xmlDoc2.DocumentElement.ChildNodes
If ElemList1.length=ElemList2.length Then’ check weather both xml file has
same number of childnodes
msgbox “Both XML files have same number of Child nodes”
For i = 0 to ElemList1.length-1
If ElemList1.item(i).Text=ElemList2.item(i).Text Then
msgbox “child element:”&i &” is same in both XML files”
Else
msgbox “child element:”& i &” is not same in both XML files, In XML
file 1, The valueis:”&ElemList1.item(i).Text &” and In XML file 1, The value
is:”&ElemList2.item(i).Text
End If
Next
End If
please let me know the status.
Thanks,
On Tue, Feb 8, 2011 at 8:19 AM, Rajesh Ravi <[email protected]> wrote:
> Hello Everyone,
>
> We are currently facing issue in comparing two XML files for verifying the
> schema's (1 template with blank data and 2nd production XML with data
> included) using qtp.
>
> Previously we use to work with XMLUtil.CreateXML() and then after opening
> the file, we check whether the template schema's are available here in the
> production or not.
>
> Whereas now, we have more schema's included. We need a solution, with which
> we can compare 2 files only for the schema's rather than the data compare.
>
> Requesting some one to help in this regard.
>
> Thanks,
>
> Ravi R.
>
> --
> 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
--
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