Previous Topic: XML XPath AssertionNext Topic: JSON Assertions


Ensure XML Validation

The Ensure XML Validation assertion lets you validate an XML document. You can verify whether the XML document is well-formed, you can validate against a Document Type Definition (DTD), or you can validate against one or more schemas. If you have an XML fragment, you can specify to have DevTest add the XML declaration tag. You can also specify that DevTest reports warnings as errors. You enter the XML to validate as a property.

Complete the following fields:

Name

Defines the name of the assertion.

If

Specifies the behavior of the assertion from the drop-down list.

then

Specifies the step to which to redirect if the assertion fires.

Log

Identifies event text to print if the assertion fires.

Source

The property that contains the XML. If this field is left blank, the last response is used.

Validate

Multiple validation options can be selected:

Well Formed XML

Check that XML is well-formed.

DTD Conformance

Check conformance with a DTD.

Schema(s)

Check conformance with one or more schemas.

XML Fragment

If XML is a fragment, an XML declaration is added to the top of the XML fragment.

Treat Warnings As Errors

Warnings are reported as errors.

Honor All Schema Locations

If you have multiple imports for the same namespace, this option opens each schema location instead of only the first one.

Click Run Assertion to execute the assertion.

 

Validation Tab

You can run the validation by clicking the Run Validation button. Any resulting validation errors are displayed in the Validation Error List. You can use the Validation Type option buttons to select how to handle the errors:

No Errors Allowed

The validation fails on any error.

Error Message Expressions

Errors can be marked to be ignored in the validation. If you select this option, you can select the errors to ignore in the Validation Error List.

 

Schemas Tab

Ensure XML Validation Schemas tab

Enter the information for each schema you want to use in the validation. You can also specify the default schema:

Default Schema URL

Optionally, specify the default URL of the schema.

WSDL URL

Optionally, specify a URL of a WSDL.