XML Checkpoints in QTP
XML checkpoints are used to check a specified XML file; It checks the data contents of XML Documents
Types of XML checkpoints
XML Checkpoints from application
Open QTP, Press F3(Recording), Select Insert-> Checkpoint->XML Checkpoint from application
After clicking the link qtp navigates to spy the objects in XML and adds each property.
XML Checkpoints (From Resource)
To add an XML File checkpoints, Do follow the below steps
Open QTP from Start Menu
Start Recording by pressing F3(Optional)
Choose Insert->Checkpoint->XML Checkpoint (From Recourse)
XML Source Selection –Checkpoint Properties opens up
In That Two options are available,
Create checkpoint from XML File
Load an XML file from the System, which is already stored
Enter the Internet Address (or path) along with the XML file name in the edit field; the browse button and navigate the XML file and select it.
Click ok Button, XML Checkpoint Properties dialog opens
The selected XML file will be displayed showing it’s element hierarchy and with no properties selected.
Select elements and value that want to be verified and click OK button to add the XML Checkpoints to the test, now the script will be generated in the Expert view
Ex. XMLFile(“a(infoyep.com).xml”).Check CheckPoint(“a(infoyep.com).xml”)
Save the file and run the script and view the result in the Result Window.
Create checkpoint for test object
By default it shows as “Start Menu”, add a XML or choose from the step which we need to add
Sample XML File
<?xml version=’1.0′ encoding=’us-ascii’?> ‘Define a XML Version’
<id no =”1”>
<title> Enter Title Here></title>
<description> infoyep.com sample XML</ description>
In the above code, first line is Defining a XML version, Number tag is the head of the id tag block , author, title and description’s are sub tags defined with start and end tags.