On 31/03/06, Kornelis Sietsma <[EMAIL PROTECTED]> wrote:
> Hi - I'm having some pain trying to do something that should be simple.
>
> I have a page with a number of URLs in it, of the form:
> a
> href="/myquery.do;jsessionid=12345?param1=12345&param2=abcde&param3=foo"
>
> I'm trying to simply follow one of these URLs in a new http request -
> but while I can grab the whole request into a regexp fairly easily, as
> soon as I substitute it into a HTTP Request (by putting
> "${MY_REGEXP_g1}" in the "Path" field) I have real pain - the escaped
> form of the ampersands ("&" is sent to the tested application, so
> it sees the parameters as "param1", "amp;param2", "amp;param3" and so on.
>
> Does anyone have any suggestions for getting around this? Currently
> I've changed my regexp to extract each param as a separate group, but
> it's slow to build an expression this way, and a bit fragile if the
> application changes it's parameter order or the like.
You could use a javascript or beanshell function to replace the &
with & in the output variable - assuming you want to replace them all.
You might be able to do this in the RegexExtractor itself, by wrapping
the $1$ in a function call.
Or you can do the same on the sampler.
Or you could be really sneaky and use the BeanShell Assertion to
change the value of the variable. This relies on the fact that
Assertions are called after the Post-Processors, so the output
variable from the Reg Ext will be available for use.
S.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]