XML HTML and QTP Part1

Updated On Mar 26, 2014 by Ankur Jain

With this, I am starting a series of post on QTP and XML. To set the tone for discussion, I would start with the basics of XML and the differences between XML and HTML.

What is XML?

XML is a markup language much like HTML. The prime use of XML is to store, carry, and exchange data. Being hardware and software-independent, XML has been widely accepted (W3C standard) as the means of data exchange between disparate systems.

XML does not really do anything – it only structures, stores or sends information.

For example, this is a note stored as XML:

[code]
<note>
<to>LearnQTP</to>
<from>Ankur Jain</from>
<heading>XML</heading>
<body>XML and QTP</body>
</note>
[/code]

The note has a header and a message body, sender and receiver information. Nevertheless, this XML document is nothing other than well-formed data. Someone must write a piece of software to send, receive, display or interpret it.

Software that can handle plain text can also handle XML. In a simple text editor, the XML tags will be visible. In an XML-aware application however, the XML tags can be handled specially (may or may not be visible, or have a functional meaning).

XML vs HTML :

HTML describes presentation. It is used to display data and focuses on how data looks. For example, in the HTML below, Bibliography is the header, the rest of the text is in paragraphs with the text with <i>..</i> is italicized.

[code]
<h1> Bibliography </h1>
<p> <i> Foundations of Databases </i>
Abiteboul, Hull, Vianu
Addison Wesley, 1995
<p> <i> Data on the Web </i>
Abiteoul, Buneman, Suciu
Morgan Kaufmann, 1999
[/code]

XML describes content. It is used to describe data and focuses on what data is.
For example, in the XML below, bibliography is an element with child element books.

[code]
<bibliography>
<book> <title> Foundations… </title>
<author> Abiteboul </author>
<author> Hull </author>
<author> Vianu </author>
<publisher> Addison Wesley </publisher>
<year> 1995 </year>
</book>

</bibliography>
[/code]

HTML can also use XML for storing its data and concentrate on the presentation, so that changes to data do not affect the HTML. In that sense, XML is a complement to HTML, it is not a replacement for it.

To get info on how to insert XML checkpoint and use of it, refer the post on XML checkpoints and QTP.

Welcome new readers: Download the Free eBook!

Ankur JainI am Ankur Jain, the owner of LearnQTP and founder of a software organization. This site is run, maintained and updated by me and my team. Feel free to take a look around, you may want to start with What is QTP? 

You can connect with me on my Google+ page. 

Please enter your first name and email address below to instantly download the eBook on Optimizing QTP Scripts. In future, we will make sure you get new tips & tricks on QTP delivered direct to your email box.



Share This Article:

10 Comments

  1. veena

    Hi,

    How to convert an excel file to xml using vbscript..

    Thanks

  2. fayazkhan

    Hi Jain can you explain about webservice testing

  3. Vijay Uppara

    Thats a neat short description of XML and HTML. Thanks for posting

  4. seenu

    iam unable to identify the cell values in a table. in the run time the QTP ASSUMES the entire table as one cell(1,1), i wanted to to get the perticular cell value. iam working on the web application.. can any one help me out on this

  5. megha

    Hi,
    As I don’t want QTP interface in between my application & test script so i decided to use html. I just want to know how will html call QTP.

  6. P Ahire

    Does QTP provide support for comparison of XML results obtained for a test case?

    Do we get the complete XPATH of the element/attribute that was different?

    Can we configure a file to ignore certain elements/attributes that we expect to have a difference and then have QTP ignore those elements/attributes in the comparison?

  7. NIma

    Can some one tell me what is xHTML plz?
    Thanks

  8. Ankur

    @Khizer: Thanks!

    @Isha: Thanks. Perfect. That is how it helps in making apps “platform independent”

  9. Isha

    Good article..
    I would like to add an example on the usage of XML. As said in this article XML primariy use is to store and exchange data.Lets say there are two web servers. Both wants to exchange some piece of info but understands diff example. In that case our 3rd party will be XML which takes the input from ist server and will send it to 2nd server.Thus both server can communicate though there is diff in language.

  10. Khizer

    Good Article buddy. keep posting.
    -Thanks
    khizer

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>