You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Massas <mu...@hotmail.com> on 2009/02/19 10:57:16 UTC

If Controller failing

Hello!

I'm trying to use an If Controller but aparently I'm not understanding the
function so i'm reaching out for help.

I want to check whether one of my regexp extractors have found a match or
not, so I'm trying to match the default value.

Here's what i put in my if controller:

"${getResponse2}" != "NoRegExpMatch2"

Meaning that i want the controller to trigger if the getResponse2 does not
have the default value.

But here's the problem, i only get a fault in the logfile, and i cannot find
the solution.

2009/02/19 10:18:51 ERROR - jmeter.control.IfController: unterminated string
literal (<cmd>#1) org.mozilla.javascript.EvaluatorException: unterminated
string literal (<cmd>#1)
	at
org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:98)

what am i missing? It feels like i've tried with and without quotes,
different type of quotes (' "), quoting the default value in the RegExp
extractor etc, but still the same error.


Would deeply appreciate some help here.

Thanks in advance

p.s. i know that the statement is true
-- 
View this message in context: http://www.nabble.com/If-Controller-failing-tp22097151p22097151.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: If Controller failing

Posted by Massas <mu...@hotmail.com>.
> from "unterminated string literal (<cmd>#1)" it looks like ${getResponse2}
may
> not exist. Try putting a debug sampler before the IfController and see
> what
> variable values are assigned by the Regexp
>
> Regards,
> Noel
> 

It seems like you hit the spot here Noel. Thanks for your reply.
The problem i had was that when addressing the groups of the RegExp match
(e.g ${getResponse2_g1}) i thought i still could use the ${getResponse2} for
comparison.

It seems like a better comparison is {getResponse2_g} which is null if no
match is found.

again, thanks

-- 
View this message in context: http://www.nabble.com/If-Controller-failing-tp22097151p22098700.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: If Controller failing

Posted by Noel O'Brien <no...@newbay.com>.
On Thursday 19 February 2009 09:57:16 Massas wrote:
> Hello!
>
> I'm trying to use an If Controller but aparently I'm not understanding the
> function so i'm reaching out for help.
>
> I want to check whether one of my regexp extractors have found a match or
> not, so I'm trying to match the default value.
>
> Here's what i put in my if controller:
>
> "${getResponse2}" != "NoRegExpMatch2"
>
> Meaning that i want the controller to trigger if the getResponse2 does not
> have the default value.
>
> But here's the problem, i only get a fault in the logfile, and i cannot
> find the solution.
>
> 2009/02/19 10:18:51 ERROR - jmeter.control.IfController: unterminated
> string literal (<cmd>#1) org.mozilla.javascript.EvaluatorException:
> unterminated string literal (<cmd>#1)
> 	at
> org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReport
>er.java:98)

from "unterminated string literal (<cmd>#1)" it looks like ${getResponse2} may 
not exist. Try putting a debug sampler before the IfController and see what 
variable values are assigned by the Regexp

Regards,
Noel

> what am i missing? It feels like i've tried with and without quotes,
> different type of quotes (' "), quoting the default value in the RegExp
> extractor etc, but still the same error.
>
>
> Would deeply appreciate some help here.
>
> Thanks in advance
>
> p.s. i know that the statement is true



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