jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Problems with "If" controller
Date Thu, 17 Feb 2005 18:20:47 GMT
On Thu, 17 Feb 2005 20:54:33 +0300, Vladimir Tsygankov
<Vladimir@contera.sp.ru> wrote:
> Hello to all.
> I have problems with "If" controller.
> I would like to compare some extracted from certain page variables with
> actual (expected) ones.
> It needs to decide if the test script performed correctly or not. If the
> result is not agree
> with the correct values we want to send a message to Console (test is
> performing without GUI).
> 
> Test plan is going to look like:
> ...
> - HTTP Request
> - Reg Exp Extractor (creates a variable MyVar1)
> - Loop for all ${MyVar1_g#}
>   - If Controller
>      < compares ${MyVar1_g#} with correct value taken from user
> parameter or file (function CSVRead) >
>     - send a message to Conlose ("incorrect test result")
> ...
> 
> My questions:
> 1. I couldn't force "If" to work with JMeter functions.
> How can I use in controller "If" expressions like
> ${__CSVRead(<file-name>,${__counter(false,refC)}-1)}!=${MyVar1_${refC}}
> or ${user-parameter1}!=${MyVar1_g1}
> or ${user-parameter${__counter(false,refC)}}!=${MyVar1_g${refC}}
> etc.

The If  Controller requires a valid JavaScript expression.
As far as I know, strings need to be enclosed in quotes, i.e. 

Use:      "${Var1}" != "${Var2}"

Not:       ${Var1}   !=  ${Var2}

> 2. Can I have an access from JaveScript code to JMeter variables like
> ${MyVar1_g#}?

Yes.

> 3. How can I send any string to Console?

${__logn(any string,OUT)}

> Any other ideas?

Check jmeter.log for error/warning messages.

Start with simple constant expressions and replace constants with
functions one by one.

> The best regards and thanks in advance,
> Vladimir
> 
>

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