jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Kenworthy <>
Subject RE: IF controller questions
Date Tue, 28 Feb 2017 16:31:41 GMT
Have you run with a debug sampler just before the if controller to ensure RecordError is in
fact 0 when expected? If running headless, add a xml listener to capture the output.

Your logic is sound in the script something else must be getting in the way. Are you always
passing -JRecordError=1 in your parameters if so have you got something that will overwrite
it if no error is found?

-----Original Message-----
From: Bo Bodnar []
Sent: 28 February 2017 15:55
To: JMeter Users List <>
Subject: IF controller questions

It's been a while since I messed with the IF controller, I can't find the scripts I created
a few years ago, so here goes:

I'm creating a script where I want the user to pass a parameter which turns on or off an IF
controller.  The IF controller only has a Simple Data Writer.  To wit:

jmeter -n -t FILE.jmx -JRecordError=1 etc, etc where if RecordError = 0 the IF portion is
skipped and if it is 1 that portion is not skipped.  The parameter is referenced in a User
Defined Variables page as follows:  ${__P (RecordError, 0)} and in the IF controller the condition
is ${RecordError} == 1 (and all checkboxes are unchecked).

I've deliberately introduced errors (e.g., writing to a file that cannot be written to and
the Simple Data Writer creates the log file, but the file is empty (this is regardless of
whether RecordError is 0 or 1).  I do not want this file created if RecordError=0.

This isn't rocket science but, for the life of me, I can't figure out what I'm doing incorrectly.

Thank you for your time.


   Bohdan L. Bodnar
   Lead Performance Engineer

   E-mail:                               222 South Riverside Plaza
                                                                    Chicago, IL 60606
                                                                        United States

The information included in this email and any files transmitted with it may contain information
that is confidential and it must not be used by, or its contents or attachments copied or
disclosed to, persons other than the intended addressee. If you have received this email in
error, please notify BJSS. In the absence of written agreement to the contrary BJSS' relevant
standard terms of contract for any work to be undertaken will apply. Please carry out virus
or such other checks as you consider appropriate in respect of this email. BJSS does not accept
responsibility for any adverse effect upon your system or data in relation to this email or
any files transmitted with it. BJSS Limited, a company registered in England and Wales (Company
Number 2777575), VAT Registration Number 613295452, Registered Office Address, First Floor,
Coronet House, Queen Street, Leeds, LS1 2TW.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message