tom
tom

Reputation: 1233

SoapUI multi-node match assertion

I have the following structure in response

response

I need an assertion that would check that for the given Role a given Action is present.

I know how to check for specific node with exists(...), but how do I check for an action for the role? fe. Assert that REVOKE_ROLE, UPDATE_ROLE exist for myRole.

I tried to put both expression in the same assertion, but it seems SoapUI allows only one expression per assertion. If I put them in separate assertions it will match all actions I look for regardless of the role. Is this kind of check possible using the XPath Match or am I doing it wrong and I should use some other assertion?

Upvotes: 2

Views: 202

Answers (1)

tom
tom

Reputation: 1233

I managed to solve this using XQuery Match

expression:

<Result>
{
for $x in //ns1:getUserA/RolePro/RoleProv/Role[ns4:Abbreviation="myRole"]
return data($x/../Prov/Provi/ns4:Abbreviation/text())
}
</Result>

expected result:

<Result>REVOKE_ROLE UPDATE_ROLE GRANT_ROLE</Result>

Upvotes: 1

Related Questions