Suppose your web page contains a list of links or a dropdown list, and you want to randomly select and hit a link or a value in the dropdown.
You should create a correlation parameter array to capture all the values of links on the page or all lists in the dropdown. To do this you should use web_reg_save_param on the top of the request which returns the complete list in its response.
You should create a correlation parameter array to capture all the values of links on the page or all lists in the dropdown. To do this you should use web_reg_save_param on the top of the request which returns the complete list in its response.
-----------------------------------------------
web_reg_save_param_ex ("ParamName=CorArr_requestIds","LB=\{\"requestId\":","RB=,\"","Ordinal=ALL",LAST);
web_url("requests",
"URL=https://[URL]/ge-service/rest/employees/[Cor_employeeId]/requests",
"Resource=1",
"RecContentType=application/json",
"Referer=https://[URL]/#/employees/requests",
LAST);
lr_save_string(lr_paramarr_random ("CorArr_requestIds"),"requestId");
web_url("981",
"URL=https://[URL]/ge-service/rest/employees/[Cor_employeeId]/requests/[requestId]",
"Resource=1",
"RecContent/json",
"Referer=https://[URL]/#/employees/requests",
LAST);
-----------------------------------------------
lr_paramarr_random ("Parameter_Array_Name");
returns a string containing the value of the parameter in a parameter array at a position chosen randomly by LR.
lr_save_string (param_value,param_name);
Saves a null terminated string as a parameter.
web_reg_save_param_ex ("ParamName=CorArr_requestIds","LB=\{\"requestId\":","RB=,\"","Ordinal=ALL",LAST);
web_url("requests",
"URL=https://[URL]/ge-service/rest/employees/[Cor_employeeId]/requests",
"Resource=1",
"RecContentType=application/json",
"Referer=https://[URL]/#/employees/requests",
LAST);
lr_save_string(lr_paramarr_random ("CorArr_requestIds"),"requestId");
web_url("981",
"URL=https://[URL]/ge-service/rest/employees/[Cor_employeeId]/requests/[requestId]",
"Resource=1",
"RecContent/json",
"Referer=https://[URL]/#/employees/requests",
LAST);
-----------------------------------------------
lr_paramarr_random ("Parameter_Array_Name");
returns a string containing the value of the parameter in a parameter array at a position chosen randomly by LR.
lr_save_string (param_value,param_name);
Saves a null terminated string as a parameter.