How to load external js library in Jmeter?
<p>I have the following code in a jsr223 sampler:</p>

<pre><code>var key = "key";
var dateStamp = "20160329T134359Z";
var regionName = "us-east-1";
var serviceName = "execute-api";

   var kDate= Crypto.HMAC(Crypto.SHA256, dateStamp, "AWS4" + key, { asBytes: true})
   var kRegion= Crypto.HMAC(Crypto.SHA256, regionName, kDate, { asBytes: true });
   var kService=Crypto.HMAC(Crypto.SHA256, serviceName, kRegion, { asBytes: true });
   var kSigning= Crypto.HMAC(Crypto.SHA256, "aws4_request", kService, { asBytes: true });
   vars.put("AWSKey", kSigning);
</code></pre>

<p>Now when I run it i get this error:
Response code: 500
Response message: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "Crypto" is not defined. (#6) in  at line number 6</p>

<p>Obviously I dont have the crypto libs. However I am at loss on how to load them. I downloaded all the relavant js and put them in the /lib folder and still nothing.
I downloaded this file: <a href="https://github.com/Boussetta/CryptoJS-v3.1.2" rel="nofollow">https://github.com/Boussetta/CryptoJS-v3.1.2</a>
Which handles the functions in the code above but for the life of me I have not idea how to import it.</p>

<p>TIA</p>