You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by vineeth <vi...@spi.com> on 2011/10/03 10:49:19 UTC

While controller condition always evaluating as true

In my TestPlan I have a while controller having few HTTP REQUEST Saplers as
it's child.

This While loop is being executed Infinitely for different conditions like

${__javaScript("1"!="1")}
${__javaScript("1"=="1")}
${__BeanShell(!"1".equals("1")) 
${__BeanShell("1".equals("1")) 
${__javaScript("${VariableName}"!="value")} 
${__javaScript("${VariableName}"=="value")} 

The while loop is not executed when the condition is hard coded as false.

I have tried the same with Jmeter2.4 and Jmeter2.5

What should be the proper format of the condition statement?

Thanks in advance

Vineeth



--
View this message in context: http://jmeter.512774.n5.nabble.com/While-controller-condition-always-evaluating-as-true-tp4864164p4864164.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: While controller condition always evaluating as true

Posted by sebb <se...@gmail.com>.
On 3 October 2011 13:38, vineeth <vi...@spi.com> wrote:
> It works Now
>
> The problem was that I had a javascript expression in the comment field of
> the while controller which had a syntax error in it.

If a test plan does not behave as you expect, it's always worth
checking the logi file.

> When I checked the log file there was an error on that expression.
>
> When that is removed it worked.

Thanks for lettins us know the problem has been solved.

> Cheers
>
> Vineeth
>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/While-controller-condition-always-evaluating-as-true-tp4864164p4864700.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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


Re: While controller condition always evaluating as true

Posted by vineeth <vi...@spi.com>.
It works Now

The problem was that I had a javascript expression in the comment field of
the while controller which had a syntax error in it.

When I checked the log file there was an error on that expression.

When that is removed it worked.

Cheers

Vineeth

--
View this message in context: http://jmeter.512774.n5.nabble.com/While-controller-condition-always-evaluating-as-true-tp4864164p4864700.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: While controller condition always evaluating as true

Posted by sebb <se...@gmail.com>.
On 3 October 2011 12:37, vineeth <vi...@spi.com> wrote:
>
> Thanks Sebb
>
>
> ${__javaScript("1"!="1")}
> I tried this on my colleagues system it works. But when I try the same in my
> system it fails (While controller executing infinitely).
>
> Does this have anything to do with my JDK or JRE versions.
>
> Can any one throw some light into this issue

Have you checked the jmeter.log file?

>
> Regards
> Vineeth
>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/While-controller-condition-always-evaluating-as-true-tp4864164p4864575.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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


Re: While controller condition always evaluating as true

Posted by vineeth <vi...@spi.com>.
Thanks Sebb


${__javaScript("1"!="1")} 
I tried this on my colleagues system it works. But when I try the same in my
system it fails (While controller executing infinitely).

Does this have anything to do with my JDK or JRE versions.

Can any one throw some light into this issue


Regards
Vineeth

--
View this message in context: http://jmeter.512774.n5.nabble.com/While-controller-condition-always-evaluating-as-true-tp4864164p4864575.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Re: While controller condition always evaluating as true

Posted by sebb <se...@gmail.com>.
On 3 October 2011 09:49, vineeth <vi...@spi.com> wrote:
> In my TestPlan I have a while controller having few HTTP REQUEST Saplers as
> it's child.
>
> This While loop is being executed Infinitely for different conditions like
>
> ${__javaScript("1"!="1")}

Does not run at all for me

> ${__javaScript("1"=="1")}

Agreed, never stops, but that is correct.

> ${__BeanShell(!"1".equals("1"))

Syntax error, missing final } - see log file

Once fixed, behaves correctly - i.e. does not run.

> ${__BeanShell("1".equals("1"))

Syntax error, missing final } - see log file

Once fixed, behaves correctly - i.e. does not stop.

> ${__javaScript("${VariableName}"!="value")}

Won't stop until VariableName==value

> ${__javaScript("${VariableName}"=="value")}

As expected, does not run unless the variable==value

> The while loop is not executed when the condition is hard coded as false.

Yes, that is by design.

> I have tried the same with Jmeter2.4 and Jmeter2.5
>
> What should be the proper format of the condition statement?

See

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#While_Controller

> Thanks in advance
>
> Vineeth
>
>
>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/While-controller-condition-always-evaluating-as-true-tp4864164p4864164.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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