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 are the recording modes and executing modes avialble in QTP?

3 Answers   Polaris,


hi gavasker i want how to merg OR's in QTP 8.2 by QTP Plus

1 Answers  


In what occasion we can specify global sheet and action sheet?

0 Answers  


For QTP Test Engineer, What is his contribution to the Project? Means, As as automation test engineer what is his role in the current project?

0 Answers   V2 Solutions,


Why you are Using Descriptive programming instead of Object Repository?

11 Answers  


i need the licence key for QTP V9.5 can anyone help me on getting this?

140 Answers  


what r advance features u had done in QTP?

3 Answers   HCL,


What is keyword view?

0 Answers  


what difference between client and server applications exatly?

1 Answers   Honeywell,


Why do we use breakpoints in QTP?

0 Answers  


The xls contain data. how to get number of columns form the sheet?

4 Answers   Virtusa,


Actually what is Quality center..is it Test Director or some other tool..Anybody can expalain it in detail..Thanks in advance..

3 Answers   Sony,


Categories