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:

 

${__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.

 

Thanks.

 

--Tim

Reply via email to