jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Re: How to call javascript from an script and return value
Date Wed, 22 Apr 2015 07:13:22 GMT
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

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:
Sent from the JMeter - Dev mailing list archive at

View raw message