Dynamic Transaction Names in LoadRunner
Say you want the transactions to be named dynamically depending on a parameter being used. You can use sprintf and lr_eval_string functions to dynamically create the trn names. Here is the sample code
Action()
{
char trnname[10];
sprintf (trnname, "Item_%s", lr_eval_string("{TrnType}"));
lr_start_transaction(trnname);
web_submit_data("Payment Done",...... ) ;
lr_end_transaction(trnname, LR_AUTO);
return 0;
}
Action()
{
char trnname[10];
sprintf (trnname, "Item_%s", lr_eval_string("{TrnType}"));
lr_start_transaction(trnname);
web_submit_data("Payment Done",...... ) ;
lr_end_transaction(trnname, LR_AUTO);
return 0;
}
0 Comments:
Post a Comment
<< Home