maxrussell
16 years agoContributor
Inserting a random ID into a request parameter
I have a request that has tags like this:
What I'd like to do is to pick a random value out of a list or array of ID values.
I've create a really simple little Groovy script like this:
How do I actually get the VALUE tag to use the randomly returned value?
ta
(I've had a look through the documentation, but can't really find what I'm looking for.)
<tem:Type>ID</tem:Type>
<tem:Value>4111138624</tem:Value>
What I'd like to do is to pick a random value out of a list or array of ID values.
I've create a really simple little Groovy script like this:
idnos = [4111138624, 4111155065, 4111152198]
rand = new Random();
randnhs = idnos[(rand.nextInt(3))];
How do I actually get the VALUE tag to use the randomly returned value?
ta
(I've had a look through the documentation, but can't really find what I'm looking for.)