Collections:
XML Assertion - XML Validation
How to use XML Assertion to validate XML messages in JMeter?
✍: FYIcenter.com
The XML Assertion allows you to validate if the Sampler
returns a well-formed XML or not.
It does not validate the XML based on a DTD or schema
or do any further validation.
You can follow this tutorial to see how XML Assertion works.
1. Copy and create a Test Plan called Azure-Echo-API-2.jmx.
2. Rename the first "HTTP Request" sampler to "Post a Valid XML". And an XML Assertion to the sampler.
3. Duplicate the sampler and call it "Post an Invalid XML" with the Body Data modified to:
<?xml version="1.0"?> <TestRun xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://sqa.fyicenter.com"/> <field name="ID">1</field> <field name="Name">First Run</field> <field name="Success">1</field> <field name="Reference" xsi:nil="true" /> </TestRun>
4. Run the test plan and open the "View Results Tree" listener. You see the "Post an Invalid XML" sampler failed, because the returned XML is invalid.
The picture below shows you how to use XML Assertion to
identify invalid XML responses:
Â
⇒ XPath Assertion - XPath Expression Matches
⇠HTTP POST with XML Message
⇑ Working With XML Body Messages
⇑⇑ Apache JMeter Tutorials
2018-10-08, 3443👍, 0💬
Popular Posts:
How to convert hexadecimal encoded data back to binary data (or Hex to Binary Decoding)? Hex to Bina...
How to generate IP Addresses? To help you to obtain some IP addresses for testing purpose, FYIcenter...
How to Pass Windows Environment Variable to JMeter? I want to use Windows temporary folder environme...
How to generate MAC addresses? To help you to obtain some MAC addresses for testing purpose, FYIcent...
How to perform regular expression pattern match with multiple occurrences? To perform a regular expr...