Hi, can any one help me with this scenario?
We have passwords stored in Cyberark vault where we need to fetch password for each username and pass in the Vugen script for login to application under test.
Total user names = 1000 which are in parameter file which is part of Vugen script.
Need to fetch passwords for each username from cyberark using web_reg_save_param function in Vugen script. So when script is ran, username_001 is sent and password for username_001 is captured using web_reg_save_param.
My goal is to capture all 1000 accounts in Vugen_init section using for loop and then pass to actual login request. I was able to capture all passwords using web_reg_save_param and using for loop, but I'm unable to pass corresponding password of the username since the latest password which was captured is getting passed for actual substitution in the script.
I need to pass password for username_005 as password_005. Below is my script.
vuser_init() { int i; web_set_sockets_option("SSL_VERSION", "TLS1.2"); for (i=1; i<=5; i++) { lr_start_transaction("CCPWebAPI"); web_reg_save_param("Password_Param", "LB=\"Content\":\"", "RB=\",\"", // "ORD=ALL", LAST); web_custom_request("web_custom_request", "URL=">xyz.stg.cyberark.com/.../Accounts "Method=GET", "TargetFrame=", "Resource=0", "Referer=", "Body=", LAST); lr_end_transaction("CCPWebAPI", LR_AUTO); } return 0; } Action() { lr_start_transaction("Substitute_Password"); //Dummy Request web_custom_request("web_custom_request", "URL=">xyz.stg.cyberark.com/Accounts "Method=GET", "TargetFrame=", "Resource=0", "Referer=", "Body=", LAST); lr_end_transaction("Substitute_Password", LR_AUTO); return 0; }
Edited by JHF: Code in Code-Block