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

from where we will retrieve data for data driven tests in qtp?

3 Answers  


How will you check that your test cases covered all the requirements?

0 Answers  


Excel sheet having some datas and some datas present in the application (in table). How will you compare these two datas? Write code to fetch datas from Excel sheet.

0 Answers  


how can we compare descriptive programing with a regular expression

0 Answers  


Can you tell me the differences between writing the VB script manually for a application and recording the same application in QTP , with a example?

1 Answers  


Extract a word from a sentenece?

5 Answers   IBM,


Explain building blocks of the bpt framework ?

0 Answers  


What is qtpro?

0 Answers  


what is error and fault in terms of software quality?

0 Answers   TCS,


Does QTP record on Objects created on XWindows Environment?

0 Answers   Infotech,


what r the 3 basic factor on which we determine to perform automation

6 Answers   AppLabs,


what are the attributes of QTP?

3 Answers  


Categories