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

Can we test the Word Document using QTP Tool? We should test the page size,page set up, paragraph indentation and spacing, font size of the the character int the page.

0 Answers  


can any one say that where we can download the QTP trail version ??????????

0 Answers  


How to find the difference between 2 dates in qtp?

0 Answers  


Hi all. Could anyone tell me the difference between an Action and a Function in QTP. Thanks in advance and Merry Christmas.

3 Answers   IBM,


What is the use of text output value in quicktest professional?

0 Answers  






Why we have to split actions in a test?

4 Answers  


HOW TO DO THE BATCH TESTING USING QTP?

8 Answers   CTS,


What are associated files in QTP?

2 Answers  


What is a data driven test in qtp?

0 Answers  


What is Regular Expressions?

2 Answers  


What are the Features & Benefits of Quick Test Pro ?

0 Answers   Crea,


How to call Datable values in the QTP program. exp: I have two parameters like Email id and Password this two i would like to add multiple entries in the datable to use it. What is the difference between Gobal/Action datatable

3 Answers  


Categories