Return-Path: X-Original-To: apmail-jakarta-jmeter-user-archive@www.apache.org Delivered-To: apmail-jakarta-jmeter-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 983514236 for ; Fri, 13 May 2011 13:26:17 +0000 (UTC) Received: (qmail 53007 invoked by uid 500); 13 May 2011 13:26:17 -0000 Delivered-To: apmail-jakarta-jmeter-user-archive@jakarta.apache.org Received: (qmail 52975 invoked by uid 500); 13 May 2011 13:26:17 -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 52966 invoked by uid 99); 13 May 2011 13:26:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 May 2011 13:26:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of djinns@chninkel.net designates 91.208.181.216 as permitted sender) Received: from [91.208.181.216] (HELO chninkel.net) (91.208.181.216) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 May 2011 13:26:11 +0000 Received: from localhost (localhost [127.0.0.1]) by chninkel.net (Postfix) with ESMTP id 6A46C3FC1 for ; Fri, 13 May 2011 15:25:50 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 chninkel.net 6A46C3FC1 DKIM-Signature: v=1; a=rsa-sha1; c=simple/simple; d=chninkel.net; s=dkim; t=1305293150; bh=6ZNqhpkXe/zFPpH6q+c3wpPnvIs=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=mhul8oVfd9KOTFA+Cy7NjjhX/hDbCBMp74FCnn1C9VxpBINKLhQaW4KjHuh30tezQ AEuE07T+rphVlmrVjr/SckDKTAZvjyAO+5UaoBhAbQKQQ0Qq7QfsByguiq69GhSEz5 4RzoVgMkewDuiUCa66Ss9Kskq3xYPFOgCEXxSYQ0= X-Virus-Scanned: GNU/Linux - chninkel.net Received: from chninkel.net ([127.0.0.1]) by localhost (navis.chninkel.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id n78JXHu3-QLC for ; Fri, 13 May 2011 15:25:50 +0200 (CEST) Received: from chninkel.net (localhost [127.0.0.1]) by chninkel.net (Postfix) with ESMTP id 176B13FC4 for ; Fri, 13 May 2011 15:25:50 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 chninkel.net 176B13FC4 DKIM-Signature: v=1; a=rsa-sha1; c=simple/simple; d=chninkel.net; s=dkim; t=1305293150; bh=6ZNqhpkXe/zFPpH6q+c3wpPnvIs=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=mhul8oVfd9KOTFA+Cy7NjjhX/hDbCBMp74FCnn1C9VxpBINKLhQaW4KjHuh30tezQ AEuE07T+rphVlmrVjr/SckDKTAZvjyAO+5UaoBhAbQKQQ0Qq7QfsByguiq69GhSEz5 4RzoVgMkewDuiUCa66Ss9Kskq3xYPFOgCEXxSYQ0= DomainKey-Signature: a=rsa-sha1; h=Received:X-DKIM:DKIM-Signature:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=oGeTvQVgBX3CvltFOTwDUZwahutTbzoAW2y79g52KhIZHckhDmmsSmXdWYM1rI3MTyPCfSpx7zrEB9sB2mT6l/l7NbFqXVFZx4omuyUBqdnUo0ous81xPPm730MCZMNERO0vemi4AobTioOZNXVEIs2JozdCocloZWn/mbH6Zqw=; c=simple; d=chninkel.net; q=dns; s=dk Received: from [127.0.0.1] (localhost [127.0.0.1]) by chninkel.net (Postfix) with ESMTPA id 07A2E3FC1 for ; Fri, 13 May 2011 15:25:50 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 chninkel.net 07A2E3FC1 DKIM-Signature: v=1; a=rsa-sha1; c=simple/simple; d=chninkel.net; s=dkim; t=1305293150; bh=MrN5rAAUOMzkRZdbPmP6+ly2Usg=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=cpK5TOTtphjxRTDqQpJg46xKNchX73XC/xJrW9QpzWWJwiIBD6SoCzOfCRb4ffT3i W/BZ0BA2GZSPfLUUyX5rtkSdjPje7wRxupD39mayhG+ORG4j1NMrc8kwq9XHbxmvzc McnWxAwDLtRZ4sYoWnMD98MgvJYEtx23d1u3Izvk= Message-ID: <4DCD315D.4090908@chninkel.net> Date: Fri, 13 May 2011 15:25:49 +0200 From: DjinnS User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: JMeter Users List Subject: Re: JavaScript function References: <4DCD1880.9060702@chninkel.net> <4DCD2A4B.7090903@chninkel.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Le 13/05/2011 15:13, sebb a =E9crit : > On 13 May 2011 13:55, DjinnS wrote: >> Le 13/05/2011 13:53, sebb a =E9crit : >>> On 13 May 2011 12:39, DjinnS wrote: >>>> Bonjour, >>>> >>>> I'm going crazy ! I can't used $__JavaScript{} to get a ratio. >>>> >>>> I try to use the following code (in a "User Defined Variable"): >>>> >>>> ${__JavaScript(Math.round(10*50/100))} >>> There is no such function as __JavaScript. >>> >>>> (in fact, "10" is also a value from an another "User Defined Variabl= e") >>>> >>>> This code don't work. >>>> >>>> If I try a very simple math operation, like this: >>>> >>>> ${__JavaScript(1+1)} >>>> >>>> It's ok ! >>> No, that fails for the same reason. >>> >>> See: >>> >>> http://jakarta.apache.org/jmeter/usermanual/functions.html#__javaScri= pt >>> >>>> What's going wrong with my first code ? >>> _Both_ are spelt incorrectly. >> Yes, there is a mistake in my email. >> >> So, with the correct spelt, my function is: >> >> ${__javaScript(Math.round(${var}*50/100),total)} >> >> It isn't working. > Works for me, provided that I define the "var" variable. > > What makes you think it is not working? > What are you expecting, what are you getting? > Felix, Yes, :/ , it's an another ctrl-c/ctrl-v mistake. I use this code in jmete= r: ${__javaScript(Math.round(${var}*50/100))} Seb, I try to get working threads with variables. I have 4 threads groups and=20 I want to run many tests with a differents number of simulated users. I=20 divide the number of user with a ratio in order to simulate a "real"=20 traffic. In the end, the result of the javascript execution is stored in a=20 variable used in one on my threads groups. It's ok if I replace ${var} with an integer. Obviously, var is defined=20 before. --------------------------------------------------------------------- To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: jmeter-user-help@jakarta.apache.org