SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Fore more QTP Realtime scripts, visit www.ramupalanki.com

Dim description, filepath
Set xmlDoc1 = CreateObject(“Msxml2.DOMDocument”)
xmlDoc1.load(“C:Documents and Settingsmohan.kakarlaDesktop1.xml”)’file 1
Set xmlDoc2 = CreateObject(“Msxml2.DOMDocument”)
xmlDoc2.load(“C:Documents and Settingsmohan.kakarlaDesktop2.xml”)’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

Weitere ähnliche Inhalte

Was ist angesagt?

Mule esb - How to convert from Json to Object in 5 minutes
Mule esb - How to convert from Json to Object in 5 minutesMule esb - How to convert from Json to Object in 5 minutes
Mule esb - How to convert from Json to Object in 5 minutesGennaro Spagnoli
 
Javascript foundations: Function modules
Javascript foundations: Function modulesJavascript foundations: Function modules
Javascript foundations: Function modulesJohn Hunter
 
Python in the database
Python in the databasePython in the database
Python in the databasepybcn
 
Mule esb How to convert from Object to Json in 5 minutes
Mule esb How to convert from Object to Json in 5 minutesMule esb How to convert from Object to Json in 5 minutes
Mule esb How to convert from Object to Json in 5 minutesGennaro Spagnoli
 
The Ring programming language version 1.5.2 book - Part 11 of 181
The Ring programming language version 1.5.2 book - Part 11 of 181The Ring programming language version 1.5.2 book - Part 11 of 181
The Ring programming language version 1.5.2 book - Part 11 of 181Mahmoud Samir Fayed
 
React Spotlight 2018
React Spotlight 2018React Spotlight 2018
React Spotlight 2018Phong Huynh
 
Al around ML 2017, Оксана Савенко, студентка НТУ имени Каразина
Al around ML 2017, Оксана Савенко, студентка НТУ имени КаразинаAl around ML 2017, Оксана Савенко, студентка НТУ имени Каразина
Al around ML 2017, Оксана Савенко, студентка НТУ имени КаразинаAlina Vilk
 
Omnibus database machine
Omnibus database machineOmnibus database machine
Omnibus database machineAleck Landgraf
 
Mastering the MongoDB Shell
Mastering the MongoDB ShellMastering the MongoDB Shell
Mastering the MongoDB ShellMongoDB
 
Intro to mongodb mongouk jun2010
Intro to mongodb mongouk jun2010Intro to mongodb mongouk jun2010
Intro to mongodb mongouk jun2010Skills Matter
 
Jafka guide
Jafka guideJafka guide
Jafka guideAdy Liu
 
No More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NETNo More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NETFilip Ekberg
 
Searched gems which supports only ruby 2.6
Searched gems which supports only ruby 2.6Searched gems which supports only ruby 2.6
Searched gems which supports only ruby 2.6Maki Toshio
 
Streaming using Kafka Flink & Elasticsearch
Streaming using Kafka Flink & ElasticsearchStreaming using Kafka Flink & Elasticsearch
Streaming using Kafka Flink & ElasticsearchKeira Zhou
 

Was ist angesagt? (18)

Mule esb - How to convert from Json to Object in 5 minutes
Mule esb - How to convert from Json to Object in 5 minutesMule esb - How to convert from Json to Object in 5 minutes
Mule esb - How to convert from Json to Object in 5 minutes
 
Javascript foundations: Function modules
Javascript foundations: Function modulesJavascript foundations: Function modules
Javascript foundations: Function modules
 
Latinoware
LatinowareLatinoware
Latinoware
 
Python in the database
Python in the databasePython in the database
Python in the database
 
Mule esb How to convert from Object to Json in 5 minutes
Mule esb How to convert from Object to Json in 5 minutesMule esb How to convert from Object to Json in 5 minutes
Mule esb How to convert from Object to Json in 5 minutes
 
The Ring programming language version 1.5.2 book - Part 11 of 181
The Ring programming language version 1.5.2 book - Part 11 of 181The Ring programming language version 1.5.2 book - Part 11 of 181
The Ring programming language version 1.5.2 book - Part 11 of 181
 
Sbt for mere mortals
Sbt for mere mortalsSbt for mere mortals
Sbt for mere mortals
 
React Spotlight 2018
React Spotlight 2018React Spotlight 2018
React Spotlight 2018
 
Validating a json in mule
Validating a json in muleValidating a json in mule
Validating a json in mule
 
Al around ML 2017, Оксана Савенко, студентка НТУ имени Каразина
Al around ML 2017, Оксана Савенко, студентка НТУ имени КаразинаAl around ML 2017, Оксана Савенко, студентка НТУ имени Каразина
Al around ML 2017, Оксана Савенко, студентка НТУ имени Каразина
 
Omnibus database machine
Omnibus database machineOmnibus database machine
Omnibus database machine
 
Mastering the MongoDB Shell
Mastering the MongoDB ShellMastering the MongoDB Shell
Mastering the MongoDB Shell
 
Intro to mongodb mongouk jun2010
Intro to mongodb mongouk jun2010Intro to mongodb mongouk jun2010
Intro to mongodb mongouk jun2010
 
Week 1 assignment q2
Week 1 assignment q2Week 1 assignment q2
Week 1 assignment q2
 
Jafka guide
Jafka guideJafka guide
Jafka guide
 
No More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NETNo More Deadlocks; Asynchronous Programming in .NET
No More Deadlocks; Asynchronous Programming in .NET
 
Searched gems which supports only ruby 2.6
Searched gems which supports only ruby 2.6Searched gems which supports only ruby 2.6
Searched gems which supports only ruby 2.6
 
Streaming using Kafka Flink & Elasticsearch
Streaming using Kafka Flink & ElasticsearchStreaming using Kafka Flink & Elasticsearch
Streaming using Kafka Flink & Elasticsearch
 

Ähnlich wie Compare Child Elements in XML Files

Sqlxml vs xquery
Sqlxml vs xquerySqlxml vs xquery
Sqlxml vs xqueryAmol Pujari
 
java API for XML DOM
java API for XML DOMjava API for XML DOM
java API for XML DOMSurinder Kaur
 
06 xml processing-in-.net
06 xml processing-in-.net06 xml processing-in-.net
06 xml processing-in-.netglubox
 
Inventory program in mca p1
Inventory program in mca p1Inventory program in mca p1
Inventory program in mca p1rameshvvv
 
Xml Presentation-1
Xml Presentation-1Xml Presentation-1
Xml Presentation-1Sudharsan S
 
File System Operations
File System OperationsFile System Operations
File System OperationsG.C Reddy
 
Advanced Web Programming Chapter 12
Advanced Web Programming Chapter 12Advanced Web Programming Chapter 12
Advanced Web Programming Chapter 12RohanMistry15
 
C# Advanced L03-XML+LINQ to XML
C# Advanced L03-XML+LINQ to XMLC# Advanced L03-XML+LINQ to XML
C# Advanced L03-XML+LINQ to XMLMohammad Shaker
 
04 sm3 xml_xp_07
04 sm3 xml_xp_0704 sm3 xml_xp_07
04 sm3 xml_xp_07Niit Care
 
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v Arian Gutierrez
 
Xml processing-by-asfak
Xml processing-by-asfakXml processing-by-asfak
Xml processing-by-asfakAsfak Mahamud
 

Ähnlich wie Compare Child Elements in XML Files (20)

Sqlxml vs xquery
Sqlxml vs xquerySqlxml vs xquery
Sqlxml vs xquery
 
java API for XML DOM
java API for XML DOMjava API for XML DOM
java API for XML DOM
 
XML.ppt
XML.pptXML.ppt
XML.ppt
 
06 xml processing-in-.net
06 xml processing-in-.net06 xml processing-in-.net
06 xml processing-in-.net
 
Xml
XmlXml
Xml
 
The xml
The xmlThe xml
The xml
 
Xml
XmlXml
Xml
 
Inventory program in mca p1
Inventory program in mca p1Inventory program in mca p1
Inventory program in mca p1
 
Xml11
Xml11Xml11
Xml11
 
Xml Presentation-1
Xml Presentation-1Xml Presentation-1
Xml Presentation-1
 
File System Operations
File System OperationsFile System Operations
File System Operations
 
Advanced Web Programming Chapter 12
Advanced Web Programming Chapter 12Advanced Web Programming Chapter 12
Advanced Web Programming Chapter 12
 
Dom
Dom Dom
Dom
 
C# Advanced L03-XML+LINQ to XML
C# Advanced L03-XML+LINQ to XMLC# Advanced L03-XML+LINQ to XML
C# Advanced L03-XML+LINQ to XML
 
04 sm3 xml_xp_07
04 sm3 xml_xp_0704 sm3 xml_xp_07
04 sm3 xml_xp_07
 
Tech talk
Tech talkTech talk
Tech talk
 
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v
Tipo virus espia con esto aprenderan a espiar a personas etc jeropas de mrd :v
 
Xml processing-by-asfak
Xml processing-by-asfakXml processing-by-asfak
Xml processing-by-asfak
 
Xml session
Xml sessionXml session
Xml session
 
Xml writers
Xml writersXml writers
Xml writers
 

Mehr von Ramu Palanki

Qtp sample certification questions and answers
Qtp sample certification questions and answersQtp sample certification questions and answers
Qtp sample certification questions and answersRamu Palanki
 
Qtp realtime scripts
Qtp realtime scriptsQtp realtime scripts
Qtp realtime scriptsRamu Palanki
 
Qtp questions and answers
Qtp questions and answersQtp questions and answers
Qtp questions and answersRamu Palanki
 
Qtp material for beginners
Qtp material for beginnersQtp material for beginners
Qtp material for beginnersRamu Palanki
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questionsRamu Palanki
 
Qtp interview questions and answers
Qtp interview questions and answersQtp interview questions and answers
Qtp interview questions and answersRamu Palanki
 
Qtp interview questions3
Qtp interview questions3Qtp interview questions3
Qtp interview questions3Ramu Palanki
 
Qtp complete guide for all
Qtp complete guide for allQtp complete guide for all
Qtp complete guide for allRamu Palanki
 
Qtp change excel cell color with condition
Qtp change excel cell color with conditionQtp change excel cell color with condition
Qtp change excel cell color with conditionRamu Palanki
 
Qtp certification questions
Qtp certification questionsQtp certification questions
Qtp certification questionsRamu Palanki
 
Qtp certification questions and tutorial
Qtp certification questions and tutorialQtp certification questions and tutorial
Qtp certification questions and tutorialRamu Palanki
 
Qtp certification questions2
Qtp certification questions2Qtp certification questions2
Qtp certification questions2Ramu Palanki
 
Qtp automation estimation techniques
Qtp automation estimation techniquesQtp automation estimation techniques
Qtp automation estimation techniquesRamu Palanki
 
Qtp 11 new enhacements in
Qtp 11 new enhacements inQtp 11 new enhacements in
Qtp 11 new enhacements inRamu Palanki
 
Qtp passing parameters between actions
Qtp passing parameters between actionsQtp passing parameters between actions
Qtp passing parameters between actionsRamu Palanki
 
Qtp wsh scripts examples
Qtp wsh scripts examplesQtp wsh scripts examples
Qtp wsh scripts examplesRamu Palanki
 

Mehr von Ramu Palanki (20)

Qtp sample certification questions and answers
Qtp sample certification questions and answersQtp sample certification questions and answers
Qtp sample certification questions and answers
 
Qtp realtime scripts
Qtp realtime scriptsQtp realtime scripts
Qtp realtime scripts
 
Qtp questions and answers
Qtp questions and answersQtp questions and answers
Qtp questions and answers
 
Qtp presentation
Qtp presentationQtp presentation
Qtp presentation
 
Qtp material for beginners
Qtp material for beginnersQtp material for beginners
Qtp material for beginners
 
Qtp interview questions
Qtp interview questionsQtp interview questions
Qtp interview questions
 
Qtp interview questions and answers
Qtp interview questions and answersQtp interview questions and answers
Qtp interview questions and answers
 
Qtp interview questions3
Qtp interview questions3Qtp interview questions3
Qtp interview questions3
 
Qtp complete guide for all
Qtp complete guide for allQtp complete guide for all
Qtp complete guide for all
 
Qtp change excel cell color with condition
Qtp change excel cell color with conditionQtp change excel cell color with condition
Qtp change excel cell color with condition
 
Qtp certification questions
Qtp certification questionsQtp certification questions
Qtp certification questions
 
Qtp certification questions and tutorial
Qtp certification questions and tutorialQtp certification questions and tutorial
Qtp certification questions and tutorial
 
Qtp certification questions2
Qtp certification questions2Qtp certification questions2
Qtp certification questions2
 
Qtp best tutorial
Qtp best tutorialQtp best tutorial
Qtp best tutorial
 
Qtp basic stuff
Qtp basic stuffQtp basic stuff
Qtp basic stuff
 
Qtp automation estimation techniques
Qtp automation estimation techniquesQtp automation estimation techniques
Qtp automation estimation techniques
 
Qtp 11 new enhacements in
Qtp 11 new enhacements inQtp 11 new enhacements in
Qtp 11 new enhacements in
 
Qtp sample resume
Qtp sample resumeQtp sample resume
Qtp sample resume
 
Qtp passing parameters between actions
Qtp passing parameters between actionsQtp passing parameters between actions
Qtp passing parameters between actions
 
Qtp wsh scripts examples
Qtp wsh scripts examplesQtp wsh scripts examples
Qtp wsh scripts examples
 

Compare Child Elements in XML Files

  • 1. Fore more QTP Realtime scripts, visit www.ramupalanki.com Dim description, filepath Set xmlDoc1 = CreateObject(“Msxml2.DOMDocument”) xmlDoc1.load(“C:Documents and Settingsmohan.kakarlaDesktop1.xml”)’file 1 Set xmlDoc2 = CreateObject(“Msxml2.DOMDocument”) xmlDoc2.load(“C:Documents and Settingsmohan.kakarlaDesktop2.xml”)’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