Forum Discussion

TommyTester's avatar
TommyTester
Occasional Contributor
9 years ago

Message Content Assertion - Node Missing

I am using a Message Content Assertion to verify data returned in a response against a data source.

 

Some of the elements that are returned aren't compulsory and are not always populated, e.g. <tns2:middlename/>

 

However, in the data source (Excel), this is a blank cell.

 

If the data source field is blank, i.e. no middle name, then I receive the error "Node Missing" on the response.

 

How can I get around elements not being mandatory?

2 Replies

  • Unfortunately, if you assert on an element in the request, that element is mandatory. I would suggest using an Assertion Test Step instead of asserting at the request level. For more information, see this document.

    • hadmatsingh's avatar
      hadmatsingh
      Occasional Visitor

      I came across similar problem of Node missing under message content assertion. I didn't find a solution in documentation which tells about asserting null value,