How to count the no of objects in XML file(QTP)
Answer Posted / uday kumar_anem
' To find the number of child elements for a specified
parent
Set doc = XMLUtil.CreateXML()
doc.LoadFile "e:\sample.xml"
Set elementCol = doc.ChildElementsByPath
("/Environment/Variable")
temp=elementCol.Count
msgbox(temp)
'To Find the numer of child elements for a root
Set doc=XMLUtil.CreateXML()
doc.loadfile "e:\sample.xml"
Set root = doc.GetRootElement()
temp=root.ChildElements().count
msgbox(temp)
My sample XML file is like:
<Environment>
<Variable>
<Name>Name</Name>
<Value>Uday Kumar</Value>
</Variable>
<Variable>
<Name>Designation</Name>
<Value>Senior Software Engineer</Value>
</Variable>
</Environment>
| Is This Answer Correct ? | 10 Yes | 2 No |
Post New Answer View All Answers
What is quick test pro?
in qtp 3 sheets is there in data table like global, action1, action2. I want to check the rows and columns in action2. how can check using script?
What are the Application Functions available in QTP?
How many types of recording modes in qtp? Which will be used when?
How to analyzing test results using quicktest professional?
describe some problems that u had with automating testing tool?
How many add-ins comes by default with qtp?
Connect to QC using AOM.
I am trying to install QTP 9.5 but i am getting error message saying that ("Path is \QuickTest Professional\bin\vb_init.exe") vb_init.exe file is not find. can anybody give me the advise what to do ?
What are the steps involved in the recovery scenario wizard?
What is the use of Debug Viewer?
images are dynamically changes how to compare two images with out using the bitmap
I used child objects to get the no of weblist present in the weblist.now i need to select the items present in each weblist ?How to do so
What are the Disadvantages of shared object repository?
How many types of parameters are available in quicktest professional (qtp)?