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

How to load a object repository in QTP during runtime?

2 Answers   BNP Paribas, Virtusa,


What are the types of Object Repository’s in QTP?

2 Answers   Crea,


i have opend 2 gmails i am working with 1 gmail i want to close other gmail by usig script. 2.i have 10 links in a page all of them have same properties& names i want to click on 5link by using script. 3.i have one combobox in that i want to see all the citynames in the combobox and i have to check weather hyderabad is present or not. 4. size of objectrepository. 5.what r problems we get during writing the script. 6.is it possible to compare to excel sheets in qtp if possible wht is the script. 7.example for lowlevelrecording

3 Answers   Semantic Space,


How to supress warnings from the "Test results page"?

2 Answers  


How u prepare Test result summary in QTp?

4 Answers   CGI,






how to identify the user defind varibles? plz tell me

1 Answers  


Which property do you use to retrieve or assign data into a cell in a Data Table object?

1 Answers  


WHAT IS THE USE OF "FUNCTION GENERATOR" IN QTP?

9 Answers   CTS,


Differentiate the two Object Repository Types of QTP.

5 Answers  


hi all, I have installed QTP successfully on windows vista. I am able to record and run on windows applications, but facing problem with web applications. While recording, I am able to open the web application, but when I click on any object or give login name and password, the events are not getting recorded in QTP. Could anyone solve the problem. Any settings to be done for web applications other than selecting web-addin? Waiting for replies. Thanks in advance.

4 Answers  


How to data driven test for Win objects in QTP ?

0 Answers  


How can i use Ordinal identifiers and Smart identification methods suppose i want to know the index no of check box

1 Answers  


Categories