Return-Path: X-Original-To: apmail-jmeter-dev-archive@minotaur.apache.org Delivered-To: apmail-jmeter-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A8C77173C3 for ; Wed, 22 Apr 2015 07:29:35 +0000 (UTC) Received: (qmail 83716 invoked by uid 500); 22 Apr 2015 07:29:32 -0000 Delivered-To: apmail-jmeter-dev-archive@jmeter.apache.org Received: (qmail 83689 invoked by uid 500); 22 Apr 2015 07:29:32 -0000 Mailing-List: contact dev-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jmeter.apache.org Delivered-To: mailing list dev@jmeter.apache.org Delivered-To: moderator for dev@jmeter.apache.org Received: (qmail 36650 invoked by uid 500); 22 Apr 2015 07:13:49 -0000 Delivered-To: apmail-jakarta-jmeter-dev@jakarta.apache.org X-ASF-Spam-Status: No, hits=1.3 required=5.0 tests=SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: message received from 54.76.25.247 which is an MX secondary for jmeter-dev@jakarta.apache.org) Date: Wed, 22 Apr 2015 00:13:22 -0700 (MST) From: "glinius@live.com" To: jmeter-dev@jakarta.apache.org Message-ID: <1429686802011-5722297.post@n5.nabble.com> In-Reply-To: <1429618018817-5722294.post@n5.nabble.com> References: <1429618018817-5722294.post@n5.nabble.com> Subject: Re: How to call javascript from an script and return value MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org You can use JSR223 PreProcessor , by adding it as a child of the request you're trying to parametrize, choose javascript from "Script Language" dropdown and put javascript code right there. PreProcessor will be executed before the sampler and its execution time will be excluded from sampler's elapsed time. You can use vars.put("variable_name", "variable_value"); method to store encrypted password into a JMeter variable and access it in the sampler as ${variable_name} However from the performance perspective it is better to use "groovy" language with JSR223 sampler as javascript interpreter will cause too much overhead from CPU and RAM perspectives and your load test will be resource intensive, hopefully it won't be too big problem to implement password hashing logic in groovy or java. See Beanshell vs JSR223 vs Java JMeter Scripting: The Performance-Off You've Been Waiting For! guide for details on installing groovy scripting engine and its benefits. -- View this message in context: http://jmeter.512774.n5.nabble.com/How-to-call-javascript-from-an-script-and-return-value-tp5722294p5722297.html Sent from the JMeter - Dev mailing list archive at Nabble.com.