How can we test an XML using QTP?

I have been to an interview, where they have given me an
XML which had 15 values and they have given those values on
a separate page. They asked me to write a QTP script to
check the XML is having those particular 15 values.

Answers were Sorted based on User's Feedback



How can we test an XML using QTP? I have been to an interview, where they have given me an XML ..

Answer / mats

You can test xml using xml nodes.

First you need to create xml object.

Set xmlobj=Createobject("Microsoft.xmldom")

Once the object is created you need to know how many nodes
are there in xml file.

Accordingly we need to specify the xml node path and
retrieve the values.

Is This Answer Correct ?    4 Yes 0 No

How can we test an XML using QTP? I have been to an interview, where they have given me an XML ..

Answer / jitendra

Hello All,
My understanding is that the value stored in an XML file
interms of "Tag" and "Value". A particular value is
assigned to a particular tag.
Ex:
<Environment>
<Variable>
<Name>servername</Name>
<Value>10.22.33.22</Value>
</Variable>
</Environment>

If this XML format is like this then we can write script :
Environment.LoadFromFile("c:\data.xml")
dataToCompare = Environment.Value("servername")

Now we can compare the above value with the required data
in your separate page.

Note:The above solution is also perfect. In my solution the
constraint is that (you have to know the name of all 15
tags)

Make me clear if i am wrong!!

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More QTP Interview Questions

WHAT IS THE FUNCTION (HOW TO DO) THE BATCH TESTING IN TEST DIRECTOR USING MANUAL TESTING PROCEDURE?

1 Answers   CTS,


How you can make an action as re-usable action?

0 Answers  


Hi, Can anyone tell me what type questions can be ashed in interview on QTP?

1 Answers  


I have a Webtable object in my shared object repository, say WT1, which has different index value in 2 different versions, one version having WT1's index value as 1 and other version having WT1's index value as 2. how could i use same test script to identify the WT1 object having different index values.

5 Answers  


How do we connect QC by using QTP?

2 Answers   Infosys,






Can we use Virtual Objects in Discriptive Programming?

5 Answers   Keane India Ltd,


Hi All,I am in wierd situation that my laptop is installed with QTP11 and os is xp sp3.The problem is the descriptive programming which i have written is working in other laptops and it is not working in my laptop.it is clicking the link which is above the testbox instead of typing it in textbox below it.It is same with the other working scripts written by another person.

1 Answers  


Hi any body can tell me the in detaled information about Description.Create() thanks in advance

2 Answers  


hi guys this is Keerthi, I am searching for job,so I want to know which questions are intervier asking on QTP&MANUAL&QUALITY CENTER,can u send Any one questions&Answers to my id:chinna.ammi@yahoo.co.in

8 Answers  


What is the standard timing delay for web based application in qtp?

0 Answers  


What Folder Structure following in Keyword Driven Frame work?

0 Answers  


What phases are involved in testing an application in qtp?

0 Answers  


Categories