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:
<note> <to>LearnQTP</to> <from>Ankur Jain</from> <heading>XML</heading> <body>XML and QTP</body> </note>
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.
<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
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.
<bibliography> <book> <title> Foundations… </title> <author> Abiteboul </author> <author> Hull </author> <author> Vianu </author> <publisher> Addison Wesley </publisher> <year> 1995 </year> </book> … </bibliography>
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.
Hi,
How to convert an excel file to xml using vbscript..
Thanks
Hi Jain can you explain about webservice testing
Thats a neat short description of XML and HTML. Thanks for posting
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
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.
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?
Can some one tell me what is xHTML plz?
Thanks
@Khizer: Thanks!
@Isha: Thanks. Perfect. That is how it helps in making apps “platform independent”
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.
Good Article buddy. keep posting.
-Thanks
khizer