Operations on Custom properties before replacement
I am doing response assertions using regular expressions. The responses contain certain fragments that echo values from the requests arguments, i.e. if the request is e.g.:
http://some.url/some/path?argument=foobar
the regex will read something like
<some reg-exp pattern here>$[argument]<some more reg-exp pattern here>
But unfortunately the response contains the echoed argument not "as-is" but converted to upper case, i.e. instead of:
<some response text>foobar<some more response text>
the response reads:
<some response text>FOOBAR<some more response text>
I.e. the echoed value is converted to upper case and thus the above regexp does not match. To get a regexp that matches I would need top be able to define a regexp like:
<some reg-exp pattern here>$[argument.toUpperCase()]<some more reg-exp pattern here>
Is something like that do-able?
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.
Screen Shot 2016-03-11 at 09.28.06.png
Is this on the right track for what you want?
Cheers,
Rupert