jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel O'Brien" <nobr...@newbay.com>
Subject Re: Using the __V function in an HTTP sampler
Date Fri, 06 Mar 2009 09:36:38 GMT
Maybe have a look at the For Each Controller instead of the loop controller; 
it's more suited to looping over variables in the format that your variables 
are in (var_n)

If that doesn't work for you, you can try something like this (I use this and 
it works);

${__BeanShell(vars.get("sns.testdata." + vars.get("current.sns") + ".user"))}

which takes the value of "current.sns" e.g. 'BB' and when resolved, the value 
for the variable 'sns.testdata.BB.user' is returned successful

Regards,
Noel

On Thursday 05 March 2009 19:02:12 Jason Frank wrote:
> I'm trying to accomplish something relatively basic, and getting stuck.  I
> want to use the __V() function in order to get the value of a variable,
> whose name I have to generate from another varible.  (I've seen this
> referred to as a "nested variable".)
>
> I have an HTTP Sampler inside of a Loop controller, and I want to send the
> evaluated variable's value as one of the request params.  In the section
> titled "Send Parameters With the Request", I add a parameter with name foo,
> and value of ${__V(gameId_${C})}, where C is the name of a counter
> variable.  What I want to happen is that in the first iteration, the param
> foo gets the value of the evaluation of variable ${gameId_1}, then in the
> next iteration around the loop it would use the evaluation of ${gameId_2}
> and so forth.
>
> When I look at the HTTP Sampler request, what I see is
> foo=${__V(gameId_${C})}. This implies that the function is not running at
> all.  Perhaps I am confused about where to put function calls, but the
> reference says they can go just about anywhere in the test.  I also tried
> setting a different parameter's value to another function, ${__time(YMD)},
> just to see if it was something particular to the variables I was trying to
> use.  This also resulted in the literal ${__time(YMD)} being included in
> the request, rather than the function's result.
>
> If anyone can help me out, I would appreciate it.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message