简体   繁体   中英

During performance testing using JMeter Tool - Not able to encrypt the input values using javascript in JSR223 and hybrid-crypto.js

Greetings...!

During the performance test scripting using JMeter tool: I am trying to access "hybrid-crypto.js" which I have saved in JMeter bin folder. But I am getting an error as follows enter image description here - Help me in fixing this issue & confirm me if my approach is correct?

Developer has built the encryption logic is in NodeJs and I have converted into JavaScript using JSR223 Preprocessor to encrypt the input data

window object is not something which is present in Nashorn engine as it is specific to a web browser , you won't be able to execute this code in a JSR223 Test Element because it doesn't implement browser at all.

Also be informed that the recommended scripting option for JMeter is Groovy so you should rather "convert" the encryption logic into Groovy, not into JavaScript.

More information: Beanshell vs. JSR223 vs. Java For JMeter: Complete Showdown

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM