Your SlideShare is downloading. ×
Qtp compare two xml files
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Qtp compare two xml files

1,181
views

Published on


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,181
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Fore more QTP Realtime scripts, visit www.ramupalanki.comDim description, filepathSet xmlDoc1 = CreateObject(“Msxml2.DOMDocument”)xmlDoc1.load(“C:Documents and Settingsmohan.kakarlaDesktop1.xml”)’file 1Set xmlDoc2 = CreateObject(“Msxml2.DOMDocument”)xmlDoc2.load(“C:Documents and Settingsmohan.kakarlaDesktop2.xml”)’file 2Set ElemList1= xmlDoc1.DocumentElement.ChildNodesSet ElemList2= xmlDoc2.DocumentElement.ChildNodesIf ElemList1.length=ElemList2.length Then’ check weather both xml file has samenumber of childnodesmsgbox “Both XML files have same number of Child nodes”For i = 0 to ElemList1.length-1If ElemList1.item(i).Text=ElemList2.item(i).Text Thenmsgbox “child element:”&i &” is same in both XML files”Elsemsgbox “child element:”& i &” is not same in both XML files, In XML file 1, Thevalueis:”&ElemList1.item(i).Text &” and In XML file 1, The valueis:”&ElemList2.item(i).TextEnd IfNext