C Program to get the correlation parameter value of the last ordinal in loadrunner

Below C program is to fetch the value of the last ordinal in the correlation. We will be fetching the value using the total count of values (Ordinal count) which by default will be saved in a variable CorrelationParameterName_count. This program is highly useful when the ordinal value is varying for each iteration.

C Program:

char lastval[30];

web_reg_save_param("AcctName", "LB=\",\"accountName\":\"", "RB=\"", "ORD=All", LAST);


web_url("IZ7_JP4EHCS0N0KRC0QGT3G5TT",
"URL=https://XXXXXXXXXXXXXXXXXX/?jsondata=%7B%22provider%22%3A%22%22%7D",
"Resource=0",
"RecContentType=text/html",
"Referer=https://XXXXXXXXXXXXXXXXX/?isam_post_url_client_company_name=PTY_Banking",
"Snapshot=t6.inf",
"Mode=HTML",
LAST);


sprintf (lastval, "{AcctName_%s}", lr_eval_string("{AcctName_count}"));

lr_save_string( lr_eval_string(lastval) ,"AcctName_Last");

lr_message("Account Name last value is %s", lr_eval_string("{AcctName_Last}"));

No comments:

Post a Comment