jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: While Controller | Reverse Logic?
Date Wed, 14 Sep 2011 11:23:05 GMT
On 14 September 2011 11:42, Oliver Lloyd <oliver_lloyd@hotmail.com> wrote:
> Is it possible to reverse the logic in the while controller?
>
> So, I have this:
>
> ThreadGroup
> ---Sampler         | This returns "foo"
> ------Regexp       | My regexp is "bar" (thus = false)
> ---While             | "${__javaScript("${FOO_VAR}")}"
> ------Sampler      | This returns "foobar"
> ---------Regexp   | My regexp is "bar" (thus = true)
>
> Basically, I want the test to poll a request until it sees 'bar' and then,
> at that point, it should exit the loop. My problem is the regexp returns
> 'false' when it does NOT find the text so in the example above the logic is
> reversed.

I assume the regex default value is 'false' ?

> Before I start hacking up a messy workaround I wanted to see if there were a
> more elegant solution; I feel like I am missing a '!' in the right place...

It's very tricky using a regex to not match a subsequence of a string.

I suspect the easiest solution is to change the while condition to
compare the regex var against the desired value, rather than relying
on the regex returning false.

> -----
> http://www.http503.com/
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/While-Controller-Reverse-Logic-tp4802300p4802300.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


Mime
View raw message