QA And PE

This blog discuss the various topics associated with software testing and software automation using automated tools such as QTP. You are most welcome to share topics related to software testing or comment on any topic below

Tuesday, May 19, 2009

LoadRunner - Parameterize and increase iteratively a value from database

/* Initialize variables and character buffer */
int i;
int j;
char ssbuf[12];

/* Extract the value of database parameter and convert it into int by using atoi */
i = atoi(lr_eval_string("{UPLOADID}"));

/* Output the value */
lr_output_message("Integer Value of Parameter: %d", i);

/* Extract the iteration number from NewParam which is configured to extract iteration number
j = atoi(lr_eval_string("{NewParam}"));
i = i+j;

/*  Add integer to character stream */
sprintf(ssbuf,"%d", i);

/* save the parameter value */
lr_save_string(ssbuf,"UPLOADID");
lr_output_message("Integer Value of Parameter: %d", i);

Labels:

0 Comments:

Post a Comment

<< Home