How to retrive XML file data in QTP ? using Script(Chandana)

Answer Posted / nidhi jain

Chandan, below is solution

Const XMLDataFile = <your file path>

Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = False
xmlDoc.Load(XMLDataFile)

Set nodes = xmlDoc.SelectNodes(<provide you node hierarchy>)
MsgBox "Total books: " & nodes.Length

Set nodes = xmlDoc.SelectNodes("<node hierarchy>/text()")

' get their values
For i = 0 To (nodes.Length - 1)
Title = nodes(i).NodeValue
MsgBox "Title #" & (i + 1) & ": " & Title
Next


I hope this will be helpful.

Is This Answer Correct ?    9 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to run an integrated test scenario using Multiple Actions? How to use the QTP Step Generator?

3431


Hi All , How can we decicde for pariticular frame(DataDriven or Keword Driven)in Project? Thanks Balaji

1361


Without integrating QC/Testdirector with QTP, is it possible to keep track of the defects?If yes how? How to export QTP results to an excel sheet?

1474


How to handle Java tree in QTP?

733


write the vb script for call to new action in qtp?

1843






Can any give an example(if possible templates) how to test web application using QTP. thanks in advance

1538


tell me abt a time when u had to go above &beyind the call of duty to get the job done

1428


i'm testing the webpage with QTP, in this wabpage i have to choose the CV from the window, but QTP can't recognize the object, so i used the Low LEvel Recording, but every time i run the test, QTP go to halt when it gets to the Recorded part, any solution for that?( except puting delay in the script and manuall selecting, because i've did that)

1535


Hello Everyone, Please provide me the practical example of business component concept of QTP.Like how to create business component,how to connect the quality center etc.... Thanks in advance, Gaytri

1392


Why bpt?

577


What are the challenges you faced during you entire life automation ?

991


wht type of User defined functions or Java Releated functions do we write in VB scripting

1809


Is it possible to merge two object repository files in qtp?

606


What is the difference between local and shared object repository in qtp?

542


If I am scripting Web-based Surveys using QTP that open up differently but at the exact same point require a username and password can I automate that username and password for all the surveys some how using QTP?

1423