You can use  JSR223 PreProcessor
<http://jmeter.apache.org/usermanual/component_reference.html#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!
<http://blazemeter.com/blog/beanshell-vs-jsr223-vs-java-jmeter-scripting-its-performance>
  
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.

Reply via email to