I tried to generate password and confirm password using POSTMAN script, but to no avail. The pre-request script I tried to generate new password is as such:
var newPass = "Ab{{$randomInt}}{{$randomInt}}!";
pm.environment.set("cs_newPassword", newPass);
in the request body I try to get the cs_newPassword variable and send it as new password and confirmation password:
{
"mobileBankerId" : "{{id_cs}}",
"currentPassword" : "{{password_cs}}",
"newPassword" : "{{cs_newPassword}}",
"confirmPassword" : "{{cs_newPassword}}"
}
When the new password and the confirm password is accepted in the server, it has different value, and therefore it was rejected, because the new password and the password confirmation was mismatch.
When I used the "generate code snippet" feature to see the code, the variable cs_newPassword content is shown and it has same value.
Actually I called the generate password script is only once, but why it has different value when I tried to access the variable?