jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Kappen <akap...@gmail.com>
Subject Re: While Controller help!
Date Mon, 06 Jun 2005 19:46:28 GMT
Adding a Response Assertion and using a while condition of LAST worked great.

On the other hand, I have tried both the
${__javaScript("${encodedState}"!="ENCODED")} and the
${__BeanShell(!"${encodedState}".equals("ENCODED")) forms suggested,
and the While Controller still just enters an infinite loop.  I read a
comment on another forum somewhere that implied the While Controller
does not re-evaluate the condition during each loop, but there was no
mention of the jmeter version effected.  Is this apparently broken
behavior a side effect of the 'alpha' nature of the while controller? 
Should I file a bug on this?

Cheers,
AK


On 6/1/05, sebb <sebbaz@gmail.com> wrote:
> On 6/1/05, Andy Kappen <akappen@gmail.com> wrote:
> > I have been trying to use the "While Controller" in JMeter 2.0.3 with
> > no luck.  This could be due
> > to two things: user error (since I'm not sure my Condition is in the
> > correct form), or the While
> > Controller is a little too alpha not work as advertised.
> >
> > Inside the While Controller, I grab a page using "HTTP Request
> > Sampler" and use "Regular
> > Expression Extractor" to populate a variable called "encodedState".  I
> > would like the While
> > Controller to loop until encodedState equals the string "ENCODED".
> 
> Another way to do this would be to use the LAST condition with a
> suitable Response Assertion to flag the Sampler as failed.
> 
> > I have tried a variety of conditions on the While Controller with no
> > luck.  What should the
> > condition look like?  Javascript?  Pure java?  BeanShell?  I tried
> 
> This is documented here:
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#While_Controller
> 
> > several guesses:
> 
> Assume encodedState = ENCODED.
> 
> >   ${encodedState} != "ENCODED"
> 
> This is interpreted as the string:
> 
> ENCODED != "ENCODED"
> 
> which is not the same as FALSE or false.
> 
> >   ${__javaScript(${encodedState}!="ENCODED")}
> 
> Almost correct, this is interpreted as the string:
> 
> ENCODED != "ENCODED"
> 
> which is not valid JavaScript
> [well, unless ENCODED is a JavaScript variable]
> 
> ${__javaScript("${encodedState}"!="ENCODED")}
> 
> should work, i.e. quote the string.
> 
> >   !(${encodedState}.equals("ENCODED"))
> 
> This is interpreted as the string
> 
> !(ENCODED.equals("ENCODED"))
> 
> which is not false or FALSE
> 
> Try
> 
> ${__BeanShell(!"${encodedState}".equals("ENCODED"))
> 
> S.
>

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


Mime
View raw message