You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by JE...@mb.bluecross.ca on 2004/09/14 15:54:50 UTC

if controllers not working?

I am having a problem with a test containing if controllers.

I use the Regular Expression Extractor to test a response and set a 
variable to "good" or "bad".

I then use an if controller to control execution of subsequent tests. My 
condition looks like:

'${foo}' == 'good' (thanks, sebb!)

This works correctly on the first pass, but after one request sets ${foo} 
to "bad", the if controllers evaluate to false for *every* subsequent 
request, The Regular Expression Extractor continues to return new, correct 
values each time.

I have tried different ways of expressing the if condition, but have had 
pretty much the same result every time. Some forms I have tried are:

${foo} == good

$foo == good

${foo} == 'good'

${foo} == "good"

and every permutation of these forms.

Does anyone know how to make these things work?

Jonathan Esterhazy

Re: if controllers not working?

Posted by sebb <se...@gmail.com>.
I found a similar problem - it looked like the If Controller was not
resolving its condition on every invocation.

If you are using a recent version of JMeter, that has a __log()
function which logs its parameter and returns it, so you could try

${__log('${foo}' == 'good' )}

and see what happens.

S.
On Tue, 14 Sep 2004 08:54:50 -0500, jesterh@mb.bluecross.ca
<je...@mb.bluecross.ca> wrote:
> I am having a problem with a test containing if controllers.
> 
> I use the Regular Expression Extractor to test a response and set a
> variable to "good" or "bad".
> 
> I then use an if controller to control execution of subsequent tests. My
> condition looks like:
> 
> '${foo}' == 'good' (thanks, sebb!)
> 
> This works correctly on the first pass, but after one request sets ${foo}
> to "bad", the if controllers evaluate to false for *every* subsequent
> request, The Regular Expression Extractor continues to return new, correct
> values each time.
> 
> I have tried different ways of expressing the if condition, but have had
> pretty much the same result every time. Some forms I have tried are:
> 
> ${foo} == good
> 
> $foo == good
> 
> ${foo} == 'good'
> 
> ${foo} == "good"
> 
> and every permutation of these forms.
> 
> Does anyone know how to make these things work?
> 
> Jonathan Esterhazy
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org