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 Folder Structure following in Keyword Driven Frame work?
How to Test the mainframe application?
What is quicktest professional?
What is QTP scenario.
What is the difference between shared and local object repository?
How does qtp recognize objects in aut?
How to test login module with different username and password by using data driven testing in QTP?
can anyone tell me from where i can download qtp demo or crack version
What is the file extension of the code file in qtp?
Thanks....But can u tell me how i use the QTP for GIS with one Example...
How to write business scripts using object repository with different scenarios
i am new QTP... please tell me automation frameworks , types & for whiich type of applications frameworks are used & how to generate script in keyword driven framework
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)
i need code for how to click on particular mail in utlook mail box .its urjent Thank You Balaji
How to handle dynamic objects in quicktest professional (qtp)?