Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to count the no of objects in XML file(QTP)



How to count the no of objects in XML file(QTP)..

Answer / 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

More QTP Interview Questions

How do I get the QTP scripts result in xml format by using vb script function?

0 Answers  


How many types of status are there?

0 Answers  


what is meant by Utility object and utility functions?can u all pls explain these clearly.

1 Answers  


HI, Anybody can explain Automation Test Framework...and wht do we do before start of Automation.....

5 Answers   Polaris, Siemens,


Hi, Can any body please tell me how to create framework in qtp & where i can get some material to learn about it. regards, rahulT

1 Answers  


How can you pass value one action to another action?

0 Answers  


Can anyone share/send me QTP 8.2 Crack as I had it before but now it's virus affected. Pls send me on Sawale.vijay@gmail.com Thanks, ~Vijay

0 Answers   Zensar,


How to analyzing the checpoint results?

0 Answers  


Hi guys can any plz help me how to send fax in sample Flight Appication

1 Answers  


What is parameterization? What is syncronization pt.?

3 Answers   Semantic Space, SRM,


what is meant by source control?

0 Answers   Ordain Solutions,


Any one knows about descriptive programming to identify objects in a page? Kindly drop me mail prasanna.sabat@gmail.com

3 Answers  


Categories