JMeter – XML Assertion

In JMeter, XML Assertion is mainly used to validate the format of XML embedded in the response. This type of assertion does not need any input. When the response is well XML formatted then the sampler is passed else failed with an error.

JMeter - XML Assertion
Figure 01: JMeter – XML Assertion

Failure Case:

JMeter - XML Assertion
Figure 02: XML Assertion failure

How to add ‘XML Assertion’?

You can follow the below steps:

  1. Select the ‘Sampler’ node whose response should be in XML format
  2. Right-click on the sampler element
  3. Hover the cursor on ‘Add’
  4. Hover the cursor on ‘Assertions
  5. Click ‘XML Assertion’

How to remove ‘XML Assertion’?

You can follow the below steps:

  1. Select ‘XML Assertion’ element
  2. Right-click on ‘XML Assertion’ element
  3. Click ‘Remove’ (Mouse) or ‘Delete’ button from the keyboard
  4. Click ‘Yes’    

Input fields

‘XML Assertion’ has the generic input fields which are:

  1. Name: To provide the name of the assertion.
  2. Comments: To provide arbitrary comments (if any)

Leave a Comment