Category Archives: UFT

XMLUtil object in UFT

XMLUtil object is used to work with XML files in UFT.

Look at below XML file.





You can read above XML file using XMLUtil object using below script.

Set xmlObj = XMLUtil.CreateXML()
Msgbox xmlObj.ToString()

Set cars= xmlObj.ChildElementsByPath("//cars//car//name")
 msgbox cars.Count
'iterate through the collection of cars

 For i = 1 to cars.Count
   msgbox cars.Item(i).Value()