jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnson, Tommy" <Tommy.John...@sabre-holdings.com>
Subject RE: Syntax for Condition in If Controller?
Date Thu, 17 Jun 2004 20:27:29 GMT
Thanks again, Udele, that worked.  Guess I've been doing Java for too long and forget about
single quote syntax in JavaScript.  I was really thrown by the fact that "true" (no quotes)
worked, but now I realize that is a reserved word in JavaScript.

Regards,
-Tommy


-----Original Message-----
From: Udele Malabanan [mailto:Udele.Malabanan@na.whiteclarkegroup.com]
Sent: Thursday, June 17, 2004 2:28 PM
To: JMeter Users List
Subject: RE: Syntax for Condition in If Controller?


Have you tried using single quotes?  This condition works for me:

'${abc}' == 'Alphabet'

-----Original Message-----
From: Johnson, Tommy [mailto:Tommy.Johnson@sabre-holdings.com] 
Sent: Thursday, June 17, 2004 3:18 PM
To: jmeter-user@jakarta.apache.org
Subject: Syntax for Condition in If Controller?



I'm running JMeter 2.0.1 now, and having great difficulty with the
syntax of the "Condition" field of the If Controller.  The only way I've
managed to get it to evaluate as TRUE was to put the string "true" in as
the Condition.  I can't figure our the JavaScript syntax it wants to
execute a conditional.  What is the correct syntax to compare a JMeter
variable to a static string and return a boolean?  I want to compare my
variable ${res} to the string "ERROR", and return true if they are
equivalent.

I tried these syntaxes:

"${res}"=="ERROR"
${res}=="ERROR"
${res}==ERROR

${javascript(("${res}"=="ERROR"),foo)} 
${javascript((${res}=="ERROR"),foo)} 
${javascript((${res}==ERROR),foo)}

I also tried setting the value of ${res} to "true" directly and simply
putting "${res}" as the Condition, but that did not work either. Only
hardcoding the condition as "true" caused the samplers under the If
Controller to run for me.

Thanks in advance!

---------------------------------------------------------------------
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


---------------------------------------------------------------------
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