On 26/09/06, Marc Anthony Winoto <[EMAIL PROTECTED]> wrote:
While trying to reproduce Philip's BeanShell problem, I found some strange
behaviour.
HTTP Sampler
|
|-Regex: test, (the), $1$, 1, "fout"
|
BeanShell PostProcessor or PreProcessor: print(${test}); or print(""+${test});
This would be interpreted as
print(the); or print(""+the);
which is not valid unless you define the BeanShell variable "the".
JMeter variables are replaced *before* the script is passed to Beanshell.
To print a JMeter variable in BeanShell, you need to use:
print("${VAR}"); or print(vars.get("VAR"));
|
|
HTTP Sampler: go to http://${test}
The bean shell never got a value for test. I can print out hardcoded strings
and predefined
variables though.
The 2nd HTTP sampler does get a correct value from the test variable and tries
to go to
http://the (and fails).
I also tried putting the beanshell as a child of the first http sampler.
Nothing. What's going on?
See also other thread - Post-Processors are run in reverse order
(don't know why yet).
Marc
---------------------------------------------------------------------
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]