I had the same problem using NEOLOAD, so I included the following script before the Auth answering machine.
// Get variable value from VariableManager var doLoginIDString = context.variableManager.getValue("doLoginID"); if (doLoginIDString==null) { context.fail("Variable 'doLoginID' not found"); } logger.debug("doLoginIDString="+doLoginIDString); var rsa = new RSAKey(); rsa.setPublic(doLoginIDString,'10001'); var res = rsa.encrypt('<USER_PASSWORD>'); logger.debug("encrypted_var= "+res); if (res) { context.variableManager.setValue("crypted_Password",res); }
VariableManager is a NEOLOAD variable manager :)
"doLoginID" is a variable that I created based on the string that the server sends to enter your password. This string can be found in the LoginPage source code.
"crypted_Password" is a variable created for the encrypted POST parameter.
RSAKey (), setPublic () and encrypt () are included in the .js files that you download from the server when accessing the login page. I just include these files in my project library and it worked.
I don’t know if it matches with JMeter, but hope this helps you understand what you need to do.
source share