Search code examples
javascriptjmeterhmacsha256cryptojs

How to call an external JavaScript files methods from JMeter


I'm trying to produce a HMAC SHA256 signature for a SOAP/XML-RPC JMeter Request that I am building. I have found a JavaScript library that should do the trick for me:

http://code.google.com/p/crypto-js/#HMAC

The issue is that I can't find a way to call the external JavaScript files methods from JMeter.

Any help would really be appreciated with this or a suggestion for an alternative to preform the task.


Solution

  • You don't need to use any external JS libraries to generate HMAC. This functionality is available in Java SE. You can use Beanshell Sampler to execute Java code.

    If this functionality wouldn't be available in Java SE, you could:

    • use OS Process Sampler
    • use BSF Sampler, set language to javascript and attach file with script
    • put Jar of chosen library to Jmeter's lib folder. Then this library will be loaded by JMeter at startup time and you can use it through Beanshell sampler