Forum Discussion
Jasper175
12 years agoFrequent Contributor
A very difficult but good question...
The answer you don't want is "I don't know" exactly - I've been using SoapUI for 4 years now.
There are a few things you could do but rather annoying.
1. The best way in PRO is "Message Content Assertion"
> This is rather a nice addition, but again you're stuck with PRO as well as the "assertion" rules and not exactly just eye-shot comparing.
But This is the way I would go if you want to match EVERY return field.
The other issue is if your response if "null" in any field is NOT returned in your element you will run into a problem.
2. XPath Match between two testSteps
> Same concept but you can use in free version. In your second step you can set the XPath Match and point to the previous run step.
The issue is you're actually looking for a "MATCH" TRUE - which is most likely what you don't want.
3. Groovy Script assertion is probably better flexibility.
> This you can "GET DATA" on each field you want to compare.
def xml1-firstname = context.expand( '${getCustomerInfo1#Response#declare namespace ns2=\'http://work.com/services/servicelayer\'; //ns2:GetCustomerInfoResponse[1]/ns2:regions[1]/ns2:name[1]}' )
def xml2-firstname = context.expand( '${getCustomerInfo2#Response#declare namespace ns2=\'http://cleveland.vonage.com/services/servicelayer\'; //ns2:GetCustomerInfoResponse[1]/ns2:towns[1]/ns2:nxx[1]}' )
xml1-firstname == xml2firstname
or
xml1-firstname != xml2firstname
Again VERY tedious work and annoying because you will need a specific code parameter if you want it to == or !=
It would be nice if SoapUI can add a XPath MisMatch
The answer you don't want is "I don't know" exactly - I've been using SoapUI for 4 years now.
There are a few things you could do but rather annoying.
1. The best way in PRO is "Message Content Assertion"
> This is rather a nice addition, but again you're stuck with PRO as well as the "assertion" rules and not exactly just eye-shot comparing.
But This is the way I would go if you want to match EVERY return field.
The other issue is if your response if "null" in any field is NOT returned in your element you will run into a problem.
2. XPath Match between two testSteps
> Same concept but you can use in free version. In your second step you can set the XPath Match and point to the previous run step.
The issue is you're actually looking for a "MATCH" TRUE - which is most likely what you don't want.
3. Groovy Script assertion is probably better flexibility.
> This you can "GET DATA" on each field you want to compare.
def xml1-firstname = context.expand( '${getCustomerInfo1#Response#declare namespace ns2=\'http://work.com/services/servicelayer\'; //ns2:GetCustomerInfoResponse[1]/ns2:regions[1]/ns2:name[1]}' )
def xml2-firstname = context.expand( '${getCustomerInfo2#Response#declare namespace ns2=\'http://cleveland.vonage.com/services/servicelayer\'; //ns2:GetCustomerInfoResponse[1]/ns2:towns[1]/ns2:nxx[1]}' )
xml1-firstname == xml2firstname
or
xml1-firstname != xml2firstname
Again VERY tedious work and annoying because you will need a specific code parameter if you want it to == or !=
It would be nice if SoapUI can add a XPath MisMatch
Related Content
- 7 years ago
- 2 years ago
- 9 years ago