This post is in part 2 of the series in XML, HTML and QTP. Here we will discuss in detail about using XML Checkpoints in QTP (UFT). In part 1 we discussed about the basics of XML, HTML and differences between them. For part 1, please refer XML and QTP Part1.

Broadly speaking, with QTP, XML can be used in two ways:

As an XML checkpoint. – This is the topic for today’s post OR User-defined external environment variables. – This will be covered in the next post.

For all the examples in this post, we will use http://www.w3schools.com/XML/simple.xml

XML checkpoints are further classified into 3 types:

  1. XML Web Page/Frame Checkpoint. Checks an XML document within a Web page or frame.
  2. XML File Checkpoint. Checks a specified XML file.XML Checkpoints QTP
  3. XML Test Object Checkpoint. Checks the XML data for an object or operation.

So how can we insert an XML Checkpoint?
Simple start recording. Insert > XML Checkpoint(From Application- In case of Web Page checkpoint) OR XML Checkpoint (From Resource – In case of File/Test object Checkpoint) and point the ‘hand’ on your application, in our case on http://www.w3schools.com/XML/simple.xml. You will get something like this:
XML Checkpoint Properties
Click on the button (as shown above) to parameterize the values of corresponding elements.

Here are some of the common uses of XML checkpoint:

  • It can be used to verify data changes across builds.
  • It can be used to verify whether the structure(hierarchy) of the XML file matches to with the schema. Change of structure of an XML file can lead to problems in processing XML file.

Some points to note about XML checkpoints:

  • The only difference between XML Web Page/Frame Checkpoint and XML File Checkpoint is that the former can be done only during recording and can be done on an LIVE XML source selectionapplication while in the case of latter, checkpoint can be inserted from the files residing on your hard disk.
  • In the case of XML Test Object checkpoint, a drop down named “Method Name” comes up, if you select a WebServiceTest Object (as shown in the image)
  • You can also use relative paths while ‘browsing’ for a file using XML File checkpoints.
  • You can’t insert an XML checkpoint from Active screen

There is much more to XML then that we have discussed yet. In future posts, I intend to cover the advanced topics on XML.