Return-Path: Delivered-To: apmail-jakarta-jmeter-user-archive@www.apache.org Received: (qmail 70635 invoked from network); 12 Jun 2007 22:26:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jun 2007 22:26:23 -0000 Received: (qmail 69287 invoked by uid 500); 12 Jun 2007 22:26:25 -0000 Delivered-To: apmail-jakarta-jmeter-user-archive@jakarta.apache.org Received: (qmail 68685 invoked by uid 500); 12 Jun 2007 22:26:24 -0000 Mailing-List: contact jmeter-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "JMeter Users List" Reply-To: "JMeter Users List" Delivered-To: mailing list jmeter-user@jakarta.apache.org Received: (qmail 68674 invoked by uid 99); 12 Jun 2007 22:26:24 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2007 15:26:24 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of sebbaz@gmail.com designates 64.233.166.180 as permitted sender) Received: from [64.233.166.180] (HELO py-out-1112.google.com) (64.233.166.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2007 15:26:20 -0700 Received: by py-out-1112.google.com with SMTP id u77so11002pyb for ; Tue, 12 Jun 2007 15:25:59 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Lg9/pE76WiN0Zo5h96qo9J4Lif7kOqzNij7HKNZOAq/r/oW0gUiyIm+5EBz8vMAv2Z3s/mRE3lpxdtpkUjmsxyi+wP4svwmaR4Npb8AG22FGc8SzyFsEb+AoiSyILu0JO2kfGP/Asi1vrx3mqU7Hgx6Vcb//qm4cOHPHwy3KTO0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=T3cpP5ngpSIpi3aRoVRTkuTD+F8j20X2v5eMGgYcts08fbhUvRSEftuhkKHfZWuxzAnjVBl+XvDvEAzYsjd0gi9hijEAn4fKUGHslI7zaU7hvFM61po8812SJrs1jblzheZnBGROUwGVqeOi+fcJFst6D16+/4ryKRKRe+LHjAs= Received: by 10.115.32.1 with SMTP id k1mr7135207waj.1181687158867; Tue, 12 Jun 2007 15:25:58 -0700 (PDT) Received: by 10.114.168.12 with HTTP; Tue, 12 Jun 2007 15:25:58 -0700 (PDT) Message-ID: <25aac9fc0706121525u295d7850u6b750b95ae22042c@mail.gmail.com> Date: Tue, 12 Jun 2007 23:25:58 +0100 From: sebb To: "JMeter Users List" Subject: Re: How to pass a variable as a parameter to random function In-Reply-To: <11085352.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <11085352.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org On 12/06/07, bvm101 wrote: > > Within a BeanShell PreProcessor I have a following code: > > java.util.List ids = new java.util.ArrayList(); > ids.add("key1"); > ids.add("key2"); > ids.add("key3"); > > int clientSize = ids.size(); > > ${__Random(0,3 ,myRandom)}; The above line should give the clue ... try ${__Random(0,${clientSize} ,myRandom)}; > vars.put("Col_65537", ids.get(${myRandom})); > > > However, when calling random function I would like to pass a variable for > the max value, in this case "clientSize", instead of number 3. > > Your help will be greatly appreciated. If your test uses this Pre-processor a lot, you may find you get memory leaks. You could put the code in an init file, and then call a method passing in the Random number. > Thanks, > > Boban > -- > View this message in context: http://www.nabble.com/How-to-pass-a-variable-as-a-parameter-to-random-function-tf3909593.html#a11085352 > Sent from the JMeter - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: jmeter-user-help@jakarta.apache.org