You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Oliver Erlewein <ol...@erlewein.net> on 2014/08/13 05:43:46 UTC

If Controller working in wondrous ways (or not)

Hi all,

So I've been fighting the If Controller for the last days (Ubuntu 64 bit,
Java 1.7 64bit, JMeter 2.11). I have to queries that basically simulate an
If...then...Else.
${QuoteRequestId} is populated by a regexp from the previous call.

1) If Controller: ${QuoteRequestID_matchNr} > 0
Do some steps.

2) If Controller: ${QuoteRequestID_matchNr} < 1
Do some steps.

Both have no ticks in Variable Expression and Evaluate for all children. 1)
works and 2) doesn't. Nothing I tried with 2) worked. Testing for other
stuff, using javascript, jexl,...

What is going on? This is not the only time I've had this. IF Controller
seems to work only sporadically.

Cheers
Oliver

Re: If Controller working in wondrous ways (or not)

Posted by Oliver Erlewein <ol...@erlewein.net>.
Hi,

@Philippe: The jmeter.log shows nothing (i.e. no error). I'll switch it to
DEBUG level and see what happens.  The Debug Sampler always shows the
correct values for the variable. I'll need to have a think how I can
simulate this in a simple script to share here.

@Shmuel: Yes, been there done that. I tried both, string and integer
comparisons...

Cheers Oliver


On 13 August 2014 17:36, Philippe Mouawad <ph...@gmail.com>
wrote:

> Hello,
> Did you check jmeter.log for errors ?
> Could you create a simple test plan using debug sampler to show issue if it
> is?
>
> Try displaying with debug sampler the value of ${QuoteRequestID_matchNr}
>  before IfController.
> Regards
>
> On Wednesday, August 13, 2014, Oliver Erlewein <ol...@erlewein.net>
> wrote:
>
> > Hi all,
> >
> > So I've been fighting the If Controller for the last days (Ubuntu 64 bit,
> > Java 1.7 64bit, JMeter 2.11). I have to queries that basically simulate
> an
> > If...then...Else.
> > ${QuoteRequestId} is populated by a regexp from the previous call.
> >
> > 1) If Controller: ${QuoteRequestID_matchNr} > 0
> > Do some steps.
> >
> > 2) If Controller: ${QuoteRequestID_matchNr} < 1
> > Do some steps.
> >
> > Both have no ticks in Variable Expression and Evaluate for all children.
> 1)
> > works and 2) doesn't. Nothing I tried with 2) worked. Testing for other
> > stuff, using javascript, jexl,...
> >
> > What is going on? This is not the only time I've had this. IF Controller
> > seems to work only sporadically.
> >
> > Cheers
> > Oliver
> >
>
>
> --
> Cordialement.
> Philippe Mouawad.
>

Re: If Controller working in wondrous ways (or not)

Posted by Shmuel Krakower <sh...@gmail.com>.
Sounds like it does a string comparison...
You should probably follow Philippe's suggestions to troubleshoot.

Shmuel Krakower.
www.Beatsoo.org - re-use your jmeter scripts for application performance
monitoring from worldwide locations for free.


On Wed, Aug 13, 2014 at 8:36 AM, Philippe Mouawad <
philippe.mouawad@gmail.com> wrote:

> Hello,
> Did you check jmeter.log for errors ?
> Could you create a simple test plan using debug sampler to show issue if it
> is?
>
> Try displaying with debug sampler the value of ${QuoteRequestID_matchNr}
>  before IfController.
> Regards
>
> On Wednesday, August 13, 2014, Oliver Erlewein <ol...@erlewein.net>
> wrote:
>
> > Hi all,
> >
> > So I've been fighting the If Controller for the last days (Ubuntu 64 bit,
> > Java 1.7 64bit, JMeter 2.11). I have to queries that basically simulate
> an
> > If...then...Else.
> > ${QuoteRequestId} is populated by a regexp from the previous call.
> >
> > 1) If Controller: ${QuoteRequestID_matchNr} > 0
> > Do some steps.
> >
> > 2) If Controller: ${QuoteRequestID_matchNr} < 1
> > Do some steps.
> >
> > Both have no ticks in Variable Expression and Evaluate for all children.
> 1)
> > works and 2) doesn't. Nothing I tried with 2) worked. Testing for other
> > stuff, using javascript, jexl,...
> >
> > What is going on? This is not the only time I've had this. IF Controller
> > seems to work only sporadically.
> >
> > Cheers
> > Oliver
> >
>
>
> --
> Cordialement.
> Philippe Mouawad.
>

Re: If Controller working in wondrous ways (or not)

Posted by Deepak Shetty <sh...@gmail.com>.
>So if we get value as 1
Greater than 0 covers it.


On Fri, Aug 15, 2014 at 7:50 AM, Kiran Badi <ki...@yahoo.com.invalid>
wrote:

> I think I got your point Deepak but still the condition greater than 0 do
> step 1 and less than 1 do step 2.<br/><br/>So if we get value as 1 where
> will flow go step 1 or step 2?<br/><br/>I think issue is with loop and in
> whatever case I feel it will not go step 2 cos any positive value will
> satisfy step 1 since they will be greater than 0.<br/><br/><a href="
> https://overview.mail.yahoo.com?.src=iOS"><br/><br/>Sent from Yahoo Mail
> for iPhone</a>

Re: If Controller working in wondrous ways (or not)

Posted by Kiran Badi <ki...@yahoo.com.INVALID>.
I think I got your point Deepak but still the condition greater than 0 do step 1 and less than 1 do step 2.<br/><br/>So if we get value as 1 where will flow go step 1 or step 2?<br/><br/>I think issue is with loop and in whatever case I feel it will not go step 2 cos any positive value will satisfy step 1 since they will be greater than 0.<br/><br/><a href="https://overview.mail.yahoo.com?.src=iOS"><br/><br/>Sent from Yahoo Mail for iPhone</a>

Re: If Controller working in wondrous ways (or not)

Posted by Deepak Shetty <sh...@gmail.com>.
>So if you have value btw  0 and 1
unlikely - its the result of a regex controller..


On Fri, Aug 15, 2014 at 4:04 AM, Kiran Badi <ki...@yahoo.com.invalid>
wrote:

> Oliver I think you have unreachable ecode. See this first condition is
> greater than zero and second condition is less than 1. So if you have value
> btw  0 and 1 , it will never go to second loop and probably that's what you
> are seeing. <br/><br/>Do you know what's the value of variable<a href="
> https://overview.mail.yahoo.com?.src=iOS"><br/><br/>Sent from Yahoo Mail
> for iPhone</a>

Re: If Controller working in wondrous ways (or not)

Posted by Philippe Mouawad <ph...@gmail.com>.
Did you put you debug sampler just before the if controller that should be
used ?
Are you sure there is no space or something that fails conversion ?
Is the if Within an include controller ?

Put if controller in DEBUG mode and see if it helps.
Regards


On Friday, August 15, 2014, Oliver Erlewein <ol...@erlewein.net> wrote:

> Hi Pjilippe,
>
> I tried all of yesterday to produce a simple script, where this occurs but
> failed. It seems to be a certain constellation of things. So it's going to
> take me a while to reproduce. Can't share the original script as that needs
> a special network set-up and is probably too large with a big script with
> about 25 include controllers. :-(
>
> Cheers Oliver
>
>
> On 13 August 2014 17:36, Philippe Mouawad <philippe.mouawad@gmail.com
> <javascript:;>>
> wrote:
>
> > Hello,
> > Did you check jmeter.log for errors ?
> > Could you create a simple test plan using debug sampler to show issue if
> it
> > is?
> >
> > Try displaying with debug sampler the value of ${QuoteRequestID_matchNr}
> >  before IfController.
> > Regards
> >
> > On Wednesday, August 13, 2014, Oliver Erlewein <oliver@erlewein.net
> <javascript:;>>
> > wrote:
> >
> > > Hi all,
> > >
> > > So I've been fighting the If Controller for the last days (Ubuntu 64
> bit,
> > > Java 1.7 64bit, JMeter 2.11). I have to queries that basically simulate
> > an
> > > If...then...Else.
> > > ${QuoteRequestId} is populated by a regexp from the previous call.
> > >
> > > 1) If Controller: ${QuoteRequestID_matchNr} > 0
> > > Do some steps.
> > >
> > > 2) If Controller: ${QuoteRequestID_matchNr} < 1
> > > Do some steps.
> > >
> > > Both have no ticks in Variable Expression and Evaluate for all
> children.
> > 1)
> > > works and 2) doesn't. Nothing I tried with 2) worked. Testing for other
> > > stuff, using javascript, jexl,...
> > >
> > > What is going on? This is not the only time I've had this. IF
> Controller
> > > seems to work only sporadically.
> > >
> > > Cheers
> > > Oliver
> > >
> >
> >
> > --
> > Cordialement.
> > Philippe Mouawad.
> >
>


-- 
Cordialement.
Philippe Mouawad.

Re: If Controller working in wondrous ways (or not)

Posted by Kiran Badi <ki...@yahoo.com.INVALID>.
Oliver I think you have unreachable ecode. See this first condition is greater than zero and second condition is less than 1. So if you have value btw  0 and 1 , it will never go to second loop and probably that's what you are seeing. <br/><br/>Do you know what's the value of variable<a href="https://overview.mail.yahoo.com?.src=iOS"><br/><br/>Sent from Yahoo Mail for iPhone</a>

Re: If Controller working in wondrous ways (or not)

Posted by Oliver Erlewein <ol...@erlewein.net>.
Hi Pjilippe,

I tried all of yesterday to produce a simple script, where this occurs but
failed. It seems to be a certain constellation of things. So it's going to
take me a while to reproduce. Can't share the original script as that needs
a special network set-up and is probably too large with a big script with
about 25 include controllers. :-(

Cheers Oliver


On 13 August 2014 17:36, Philippe Mouawad <ph...@gmail.com>
wrote:

> Hello,
> Did you check jmeter.log for errors ?
> Could you create a simple test plan using debug sampler to show issue if it
> is?
>
> Try displaying with debug sampler the value of ${QuoteRequestID_matchNr}
>  before IfController.
> Regards
>
> On Wednesday, August 13, 2014, Oliver Erlewein <ol...@erlewein.net>
> wrote:
>
> > Hi all,
> >
> > So I've been fighting the If Controller for the last days (Ubuntu 64 bit,
> > Java 1.7 64bit, JMeter 2.11). I have to queries that basically simulate
> an
> > If...then...Else.
> > ${QuoteRequestId} is populated by a regexp from the previous call.
> >
> > 1) If Controller: ${QuoteRequestID_matchNr} > 0
> > Do some steps.
> >
> > 2) If Controller: ${QuoteRequestID_matchNr} < 1
> > Do some steps.
> >
> > Both have no ticks in Variable Expression and Evaluate for all children.
> 1)
> > works and 2) doesn't. Nothing I tried with 2) worked. Testing for other
> > stuff, using javascript, jexl,...
> >
> > What is going on? This is not the only time I've had this. IF Controller
> > seems to work only sporadically.
> >
> > Cheers
> > Oliver
> >
>
>
> --
> Cordialement.
> Philippe Mouawad.
>

Re: If Controller working in wondrous ways (or not)

Posted by Philippe Mouawad <ph...@gmail.com>.
Hello,
Did you check jmeter.log for errors ?
Could you create a simple test plan using debug sampler to show issue if it
is?

Try displaying with debug sampler the value of ${QuoteRequestID_matchNr}
 before IfController.
Regards

On Wednesday, August 13, 2014, Oliver Erlewein <ol...@erlewein.net> wrote:

> Hi all,
>
> So I've been fighting the If Controller for the last days (Ubuntu 64 bit,
> Java 1.7 64bit, JMeter 2.11). I have to queries that basically simulate an
> If...then...Else.
> ${QuoteRequestId} is populated by a regexp from the previous call.
>
> 1) If Controller: ${QuoteRequestID_matchNr} > 0
> Do some steps.
>
> 2) If Controller: ${QuoteRequestID_matchNr} < 1
> Do some steps.
>
> Both have no ticks in Variable Expression and Evaluate for all children. 1)
> works and 2) doesn't. Nothing I tried with 2) worked. Testing for other
> stuff, using javascript, jexl,...
>
> What is going on? This is not the only time I've had this. IF Controller
> seems to work only sporadically.
>
> Cheers
> Oliver
>


-- 
Cordialement.
Philippe Mouawad.