Forum Discussion
It seems impossible to enter text fragments that contain closing curley brackets. Everything from a curley bracket onwards is swalloed by this fine forum-SW! So I changed all curley brackets to square brackets hoping to get my point across. You may want to have a look for a more robust forum SW ||-(
While defining regular expressions, it may involve special characters, so you may need to escape them properly. This is just general input.
- rupert_anderson10 years agoValued Contributor
Hi,
If I'm understanding you right, you want to preprocess some properties extracted from the response before then applying standard Assertions to them?
If so, one such approach would be to use a Response Filter to change the response values before applying the Assertions - see
https://www.soapui.org/scripting---properties/custom-event-handlers.html (gives some background, but is really for the paid for version of SoapUI)
See also point 6 of https://www.soapui.org/scripting-properties/tips-tricks.html
It can also be done on the open source version, but requires coding effort, which may be more effort than its worth in this case.
Instead, have you considered using a Script Assertion instead? That way you could just extract the values from the response e.g. something like
def prop = context.expand( '${#Project#propertyA}' ) assert prop.toUpperCase()=="....."
Is this the kind of thing you were meaning?
Cheers,
Rupert
- rupert_anderson10 years agoValued Contributor
Hi,
Thanks for the edit to your question, but I think my answer is still just as relavent? Alhough the first option I suggested is probably overkill, how about just doing a Script Assertion as per my second suggestion?
Or perhaps I am missing something, but say you have TestSteps like:
1. Goovy TestStep with
context["argument"]="abcdef" //set initial value of your parameter
2. REST Request TestStep
In your Contains Assertion you can use ${=argument.toUpperCase()} to look for ABCDEF?
Also in your Contains Assertion, its less exact, but you could even tick 'ignore case' e.g.
Is this on the right track for what you want?
Cheers,
Rupert