Interview Questions   Tutorials   Discussions   Programs   Videos   

QTP - How to retrieve XML file data in QTP ?




267
views
asked marvit August 19, 2014 02:00 AM  

How to retrieve XML file data in QTP ?


           

1 Answers



 
answered By Dharma   0  

The loading of XML file in QTP is simple enough:
Const XMLDataFile = "C:\TestData.xml"
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = False
xmlDoc.Load(XMLDataFile)
How to get number of books in a bookstore?
The QTP script is:
Set nodes = xmlDoc.SelectNodes("/bookstore/book")
MsgBox "Total books: " & nodes.Length
Result is 3

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert