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)

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


Please Help Members By Posting Answers For Below Questions

What is quick test pro?

1060


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?

7180


What are the Application Functions available in QTP?

2038


How many types of recording modes in qtp? Which will be used when?

981


How to analyzing test results using quicktest professional?

1171


describe some problems that u had with automating testing tool?

1800


How many add-ins comes by default with qtp?

1027


Connect to QC using AOM.

1688


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 ?

2271


What are the steps involved in the recovery scenario wizard?

1018


What is the use of Debug Viewer?

1946


images are dynamically changes how to compare two images with out using the bitmap

2406


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

2701


What are the Disadvantages of shared object repository?

1132


How many types of parameters are available in quicktest professional (qtp)?

1036