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

1. Can anyone help me with recovery scenarios, each type with examples and also what is on error resume next?

1 Answers  


How to make arguments optional in a function?

1 Answers   Crea,


what r the executing modes in QTP

2 Answers  


what is web application and client server application.is there any difference ?

1 Answers   Wells Fargo,


How to handle the exceptions using recovery scenario manager in QTP?

1 Answers   Crea,


why is execute file used.

1 Answers   Deloitte,


How to supress warnings from the "Test results page"?

2 Answers  


how can we handle errors other than using recovery scenerios in qtp

0 Answers  


how do u handle an object with out name in our application using QTP 9.2?

0 Answers   CTS,


IF we use batch testing.the result shown for last action only.in that how can i get result for every action.

2 Answers  


what is the difference between an Action and a function in real time

4 Answers  


What are the option you can use to synchronize your test?

2 Answers  


Categories