The following would be safer:
/myServerProcess(\?.*?)"
or
/myServerProcess(\?.+?)"
if you want to ignore empty query strings
Note the additional ? to make the .* (or .+) non-greedy - otherwise it
will look for the longest possible match, which could include several
intervening "> pairs before finding the last one.
I also removed the >, otherwise it would match
/myServerProcess"x"x"x">
On 29/08/06, Michel Plungjan <[EMAIL PROTECTED]> wrote:
Excellent!!!
The actual string was
?NR=1500000&CC=EP&KC=A1">
so changing the queryString extraction
from
/myServerProcess(\?.*)
to
/myServerProcess(\?.*)">
and using
/myOtherServerProcess${__javaScript("${qString}".replace(/amp;/g\,""))}
solved the problem!!!
Oliver: You can do the same
Thanks:)
On 8/29/06, sebb <[EMAIL PROTECTED]> wrote:
> Remember that commas must be escaped using \, and that ${varname}
> substitution is done before passing the result to Javascript.
>
> So if the Javascript command is:
>
> "string".replace(/i/g,"o"), then the function call is
>
> ${__javaScript("string".replace(/i/g\,"o"))}
>
> which becomes
>
> ${__javaScript("${var}".replace(/i/g\,"o"))}
>
> On 29/08/06, Michel Plungjan <[EMAIL PROTECTED]> wrote:
> > Trying desperately to do the same as Oliver - changing the valid xhtml
> > querystring from
> > ?NR=1500000&CC=EP&KC=A1
> > to
> > ?NR=1500000&CC=EP&KC=A1
> >
> > Using
> >
> > ${__javaScript('${qString}'.replace(/amp;/g,''))}
>
> Wrong - comma not escaped
>
> > ${__javaScript("${qString}".replace(/amp;/g\,""))}
>
> Looks OK
>
> > ${__javaScript('${qString}'.replace(/amp;/g\,''))}
>
> Looks OK.
>
> >
> >
> > I just keep getting this (thanks Sebb for pointing me at the jmeter log):
> >
> > 2006/08/29 10:24:31 ERROR - jmeter.functions.JavaScript: Error
> > processing Javascript SyntaxError: unterminated string literal (<cmd>;
> > line 2)
>
> This suggests that the variable might already contain single and
> double quotes, thus enclosing it in "" or '' leaves it with unmatched
> quotes.
>
> Or perhaps there is some extraneous stuff after the Javascript
> function call - I thought Javascript errors normally quote line 1, not
> line 2, but I could be wrong.
>
> I suggest you try building up the function call gradually, using fixed
> strings initially.
>
> No need to change JavaScript engine; the problem is not with the
> engine, but with the data.
>
> You could also try replacing _javascript() with __log() to see what is
> really being passed to the engine
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]