On 04/10/06, McCune, Tim <[EMAIL PROTECTED]> wrote:
I'm trying to use the following expression in JMeter:



${myId_${__JavaScript(Math.floor(Math.random() * ${myId_matchNr}) + 1,
randomId)}}



and JMeter is evaluating it to:



${) * ${myId_matchNr}) + 1, randomId)}}



It seems to be able to handle 1 nested variable, inside of the JavaScript
function, but not the 2nd?  For instance, if I just use:

Nested variable names are not supported.



${__JavaScript(Math.floor(Math.random() * ${myId_matchNr}) + 1, randomId)}



this evaluates fine.  If I just use:



${myId_2}



this evaluates fine.  I basically have a list of strings that were extracted
by the Regular Expression Extractor (and stored in "myId_n" variables), and
I want to select one of them at random.  Is there a better way to do this?
I would appreciate any suggestions.


Why not pick a match at random initially? i.e. set Match No. to 0.

Otherwise, you will need to do this with BeanShell, something like:

${__BeanShell(vars.get("myId_${random}"))}




Thanks.



--Tim




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to