JMeter – XML Schema Assertion

JMeter - XML Schema Assertion

As discussed in the earlier post XML Assertion is a generic assertion element which is mainly used to validate the format of XML embedded in the response. When we have a requirement to validate the specific XML response then XML Schema Assertion is used in the JMeter script. In this type of assertion, we can provide the XML Schema file (along with path) which needs to be compared with the actual response. When the response is matched with the schema then the sampler is passed else failed with an error.

How to add ‘XML Schema Assertion’?

You can follow the below steps:

  1. Select the ‘Sampler’ node whose response needs to be validated.
  2. Right-click on the sampler element
  3. Hover the cursor on ‘Add’
  4. Hover the cursor on ‘Assertions’
  5. Click ‘XML Schema Assertion’
JMeter XML Schema Assertion
Figure 01: JMeter – XML Schema Assertion

What are the input fields of ‘XML Schema Assertion’ element?

‘XML Schema Assertion’ has the following input fields:

  • Name: To provide the name of the assertion.
  • Comments: To provide arbitrary comments (if any)
  • XML Schema: To specify the path and file name of the schema. 

Leave a Reply

Your email address will not be published. Required fields are marked *