Micro Focus QTP (UFT) Forums
XMLCHECKPOINTS (Testing Webservices) - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: XMLCHECKPOINTS (Testing Webservices) (/Thread-XMLCHECKPOINTS-Testing-Webservices)



XMLCHECKPOINTS (Testing Webservices) - reenuu - 03-22-2008

Hi All,

Please explain 1.what are XMLCheckpoint 2. what are they usefull for 3. what effect does UPDATE RUN mode has on them.

Thanks a lot
Reenu


RE: XMLCHECKPOINTS (Testing Webservices) - jglasser - 03-25-2008

1. XML Checkpoints check the expected data within XML elements, Attributes, and their values. You can also enable XML and Schema Validation within each XML checkpoint.

2. So if your XML response should contain certain information, you can add an XML checkpoint to make sure the values are correct. Example: make sure <user>Joe</user> is returned

3. UPdate Run Mode means that it will update the XML checkpoint structure in the event that new XML elements are added to a response. When you add an XML checkpoint, it takes a snapshot of all the elements that are in an XML request or response. If the XML is updated to add more element names, the test will fail if you dont update the element structure. Update mode will let QTP update the checkpoint to use the NEW structure but You will need to check your expected checkpoint values again


RE: XMLCHECKPOINTS (Testing Webservices) - reenuu - 03-25-2008

thanks a lot for answering my question, though i am facing a problem that still persists.
My Web Service Method take State and date as inputs(from global data sheet)
it gives an xml of structure
Code:
<Limit>
<limitid>"Numeric value here"</limitid>
<desc>"string value here"</desc>
</limit>
there can be more than <limit> set for one state.So it runs for "CA" and gimes a whole bunch of these, than It runs"AZ"and does the same.
But when i UPDATE RUN with UpdateXMLcheckpoint checked checkpoint XML has values from the last Sate only in this case"AZ" so my tests fails for "CA".
Where am i worng? So i guess i want to know where/when should i use Updaterun for xmlcheckpoints.

Thanks a lot in advance.
Reenu


RE: XMLCHECKPOINTS (Testing Webservices) - jglasser - 03-25-2008

just to clarify:
is it your XML response that contains the limit elements?

does the xml response contain all the states or are you looping through each row of the data sheet and request by a single state?

If you are getting all states in a single response, then essentially your xml structure should be consistent. If you are doing single requests on each state and each state will have a different number of limit elements causing dynamic xml response, then you have to modify the XML checkpoints to not check the number of child elements. If you have to verify the values in these dynamic elements, its best to write some vbscript to do this instead of using an XML checkpoint. XML Checkpoints are intended for XML requests/response where the structure does not change.


RE: XMLCHECKPOINTS (Testing Webservices) - reenuu - 03-25-2008

Yes, XML response contains LIMIT
Yes, i am looping thru it essentially i am providing it thru datasheet and in the result pane i have 2 iterations