Unable to run postman collection with CryptoJS in pre request script.
AnuradhaBose opened this issue · 0 comments
AnuradhaBose commented
Hi,
I have a requirement where I need to execute the following snippet in pre-request script in postman.
var computedHash = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, secret.toString());
computedHash.update(rawSignature);
computedHash = computedHash.finalize();
var computedHmac = CryptoJS.enc.Base64.stringify(computedHash);
This script works fine in postman. But when I try to run the same collection from postman-runner, I get an error- org.mozilla.javascript.EcmaError: ReferenceError: "CryptoJS" is not defined. (---------------------> POSTMAN test: #66). Is there any way to resolve this?