Reputation: 11
I have a scenario as follows: A value is extracted from the server response and is to be encrypted and pass to the subsequent request. How can it be done using bean shell. And what are the jar files I have to include to run the script?
Upvotes: 1
Views: 1582
Reputation: 58774
Generally if you have decrypt class e.g. Decryptor in jar e.g. x.jar
Click Test Plan, below in Add Library Click Browse and add your x.jar.
Add Beanshell Sampler (or JSR223 Sampler)
Get encrypted variable e.g. paramName
Put in new variable e.g. paramNameDecrypted the decrypt value
Code:
import package.Decryptor;
String decryptValue = Decryptor.decrypt(vars.get("paramName"));
vars.put("paramNameDecrypted", decryptValue)
Upvotes: 1