Also when you want to get the generated number you will use ${var1}${var2}. if you want to regenerate the number then use the functions below (say you have this inside a loop)
On Fri, May 13, 2011 at 3:18 PM, Deepak Shetty <shet...@gmail.com> wrote: > Hi > ${__Random(1000000,999999999999999,var1)}${__Random(1000000,999999999999999,var2)} > the first time you want to use it (no need for UDV). > This saves the digits into variables named var1 and var2. > > ${__javaScript("${var2}".substring("${var2}".length-4))} whenever you want > the last 4 digits > > regards > deepak > > > On Fri, May 13, 2011 at 2:15 PM, Natasha Alexander <naalix3...@hotmail.com > > wrote: > >> >> Hi everyone, >> I am very new to JMeter. Would someone be able to help me step by step >> with the following: >> 1. I need to generate a random number that may be a minimum of 14 digits >> and maximum of 30 digits long. >> [NOTE: Initially, I added a User Defined Variable under the Test Plan >> level with value: >> ${__Random(1000000,999999999999999)}${__Random(1000000,999999999999999)} >> But now I'm thinking maybe the way to go is by adding a Random Variable. >> However, if this is the way to go, I'm not certain under which level in the >> tree the element should exist.] >> >> 2. Eventually, my script should be able to extract the last 4 digits of >> the random number that was generated. This is because in the web >> application I am testing, the last 4 digits of that number will appear on a >> web page at some point. I need to verify that the last 4 digits extracted >> matches what I see on that web page. >> >> I'd appreciate any help offered... step by step :-) >> >> Thanks in advance! >> Natasha > > >