Loadrunner Custom Code to select more check box values


Note: checkboxvalueRaw is the list of correlated values which is being listed in the check boxes. It has to be checked in random numberr and submitted.

int i, j;

char checkboxvalue_param[100],temp_param[60], temp1_param[60];

web_reg_save_param(“checkboxvalueRaw”,”LB=XXXXX”,”RB=YYYYY”,”ORD=ALL”,”Notfound=warning”,LAST);

i=1;

j=(rand()%(atoi(lr_eval_string(“{checkboxvalueRaw_count}”)))+1);

lr_output_message (“i is %d, j is %d”, i,j);

do

{        sprintf (checkboxvalueRaw_param, “{checkboxvalueRaw_%d}”, i);

lr_save_string(lr_eval_string(checkboxvalueRaw_param), “checkboxvalue_sel”);

strcpy(temp_param, temp1_param);

strcat(temp_param, lr_eval_string(“{checkboxvalue_sel}”));

if (i<j)

{

strcat(temp_param, “,”);

}

strcpy(temp1_param, temp_param);

i=i+1;

}

while (i==j);

lr_save_string(lr_eval_string(temp_param), “checkboxvalue_sel”);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s