13 years ago
Assertion for specific entry from array in response
New soapUI Pro user here. I have a response with an array such as:
<MessageList>
<Message>
<MessageCode>2</MessageCode>
<MessageText>Text 2</MessageText>
</Message>
<Message>
<MessageCode>1</MessageCode>
<MessageText>Text 1</MessageText>
</Message>
<Message>
<MessageCode>17</MessageCode>
<MessageText>Text 17</MessageText>
</Message>
</MessageList>
I am using an Excel spreadsheet as a datasource to specify, for various test cases, if a specific message code should be returned. Some cases require that MessageCode 1 is returned, some cases don't require MessageCode 1 to be returned. Message codes are returned in no specific order.
For example: record #1 in the datasource needs to check that MessageCode 1 is returned, while record #2 does not care if any MessageCodes are returned.
How do I write/configure an assertion that is flexible enough to look for the MessageCode in the response when it is specified in the datasource, yet the specific placement in the response's array is not predictable?
Many thanks.
<MessageList>
<Message>
<MessageCode>2</MessageCode>
<MessageText>Text 2</MessageText>
</Message>
<Message>
<MessageCode>1</MessageCode>
<MessageText>Text 1</MessageText>
</Message>
<Message>
<MessageCode>17</MessageCode>
<MessageText>Text 17</MessageText>
</Message>
</MessageList>
I am using an Excel spreadsheet as a datasource to specify, for various test cases, if a specific message code should be returned. Some cases require that MessageCode 1 is returned, some cases don't require MessageCode 1 to be returned. Message codes are returned in no specific order.
For example: record #1 in the datasource needs to check that MessageCode 1 is returned, while record #2 does not care if any MessageCodes are returned.
How do I write/configure an assertion that is flexible enough to look for the MessageCode in the response when it is specified in the datasource, yet the specific placement in the response's array is not predictable?
Many thanks.