Each Time user login encrypted password is going to the server. I have tried to generate the encrypted password as adding a java script action and inside the javascript action I have written the below code. While trying to execute I am getting the error ReferenceError: "RSAKey" is not defined. I am very new to neoload. Can you please suggest how to resolve this
var publicKey = new RSAKey();
context.variableManager.setValue("c_modulusHexString",c_modulusHexString);
context.variableManager.setValue("c_publicExponentHexString",c_publicExponentHexString);
publicKey.setPublic(c_modulusHexString, c_publicExponentHexString);
var initSecureRandom = new SecureRandom();
var result = publicKey.encrypt(MyPassword);
var Password= hex2b64(result);
context.variableManager.setValue("Password",Password);
I've never dropped them directly in this folder, I normally do it via the GUI, under edit > JS Libraries. You shouldn't need all the js downloaded by your app. just the bit related to RSAKey. As mentioned before, because this is a class/type, it may be that you actually need some JAR files that contain this class definition.
You would get an error as the Neoload JS engine doesn’t know what RSAKey is, the line is the same as var fruit = new banana();
You need to include the library where RSAKey is defined, I assume that it is inside one of the JS files downloaded by the client. Look in you script for it using the flag feature.
If it’s not there, maybe you need to include the jar file containing the class
Hi Neil,
Thanks a lot for your input. I have downloaded the js files and added the js under \lib\jslib. How do I import this in my javascript action?
Is there alternate way to do this?