You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by ke...@comcast.net on 2005/07/08 14:53:25 UTC

While Controller

Hello,

I am trying to use a while controller, but it seems to execute infinitely 
regardless of the condition I specify. I have a user variable called 
testStatus to which I assign a default value of "foo". I extract a value 
from an HTTP response within the While Controller and want to continue to 
execute the requests withiin the while controller until the extracted value 
changes to "finished". I have verified that the value of the variable indeed 
starts out as "foo" and changes to "finished", but the while controller 
never exits. Here are some of the conditions I've tried:

${testStatus}!=finished
!${testStatus}==finished
"${testStatus}"!="finished"
!"${testStatus}"=="finished"
${__javaScript("${testStatus}"!="finished")}

I've even tried to keep the while controller from executing at all, but it 
just happily executes forever:

${testStatus}==finished
1==2

I've tried this with 2.0.3 and the 20050704 nightly build.

What am I missing? Could someone please throw me a bone, and tell me what 
I'm doing wrong?

Kevin 


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


Re: While Controller

Posted by sebb <se...@gmail.com>.
On 7/8/05, kebl@comcast.net <ke...@comcast.net> wrote:
> Hello,
> 
> I am trying to use a while controller, but it seems to execute infinitely

This is documented at:
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#While_Controller

> regardless of the condition I specify. I have a user variable called
> testStatus to which I assign a default value of "foo". I extract a value
> from an HTTP response within the While Controller and want to continue to
> execute the requests withiin the while controller until the extracted value
> changes to "finished". I have verified that the value of the variable indeed
> starts out as "foo" and changes to "finished", but the while controller
> never exits. Here are some of the conditions I've tried:
> 
> ${testStatus}!=finished
> !${testStatus}==finished
> "${testStatus}"!="finished"
> !"${testStatus}"=="finished"

These will never evaluate as the string "false".
JMeter only performs textual replacement in the above examples, as
that is all it has been asked to do. JMeter will replace the variable
testStatus by it's current value, i.e.

foo!=finished
!foo==finished
etc.

> ${__javaScript("${testStatus}"!="finished")}

This is close, however the javaScript function requires two parameters:

 http://jakarta.apache.org/jmeter/usermanual/functions.html#__javaScript

There's probably an error message in jmeter.log that confirms this.

Try

${__javaScript("${testStatus}"!="finished",dummy)}

> I've even tried to keep the while controller from executing at all, but it
> just happily executes forever:
> ${testStatus}==finished
> 1==2

These will never be "false" - they evaluate as:

foo=finished 
1==2

> I've tried this with 2.0.3 and the 20050704 nightly build.
> 
> What am I missing? Could someone please throw me a bone, and tell me what
> I'm doing wrong?

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

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