How to save parameter value to other parameter in LoadRunner?

How to save parameter value to other parameter in LoadRunner?

One my reader asked me - "How to save parameter value to other parameter in LoadRunner?". OK, there is a simple solution.

To save parameter value to other parameter you have to:
  1. Evaluate value of initial parameter
    Use lr_eval_string LoadRunner function.
  2. Save the evaluated string to a second parameter
    Use lr_save_string LoadRunner function.
Please, check the following code:
// save string value to initial parameter
lr_save_string("some string value", "prmStr1");
lr_output_message(lr_eval_string("Value of prmStr1: {prmStr1}"));

// save the evaluated value to second parameter
lr_save_string(lr_eval_string("{prmStr1}"), "prmStr2");
lr_output_message(lr_eval_string("Value of prmStr2: {prmStr2}"));
Let's execute this code and check the result:
(click the image to enlarge it)

As you can see, both parameters (prmStr1 & prmStr2) have the same values - "some string value".
So, we assigned the parameter value to other parameter successfully.

Related articles:

Do you have questions on this topic - working with LoadRunner parameters?
Feel free to post them in comments.



Sumit said...


Is there a way in which we can store the value of a response parameter into an external file or table for all the iterations performed.

Dmitry Motevich said...

Yes, there is a way. You have to save parameter value into file using C-functions.

anoop said...

Saving the parameter value into an external text file using C functions


if ((file = fopen(filename, "w+" )) == NULL) {

lr_output_message("Unable to create %s", filename);
return -1;

i = fwrite(str, strlen(str), 1, file);

if ( i > 0)
lr_output_message("Successfully wrote File");


Chinnadurai said...

Hi Dmitry,

How can I send SAP GUI status bar value to Table type parameter dynamically.

sapgui_status_bar_get_text("paramStatusBarText", BEGIN_OPTIONAL, "Recorded status bar text: Purchase requisition number 0010000297 created",

sapgui_status_bar_get_param("1", "PRNO", LAST);


how can I send this 'PRNO' to the below data_1 (table type parameter)


Thanks and Regards,
Chinnadurai R

Dmitry Motevich said...

Dear Readers!
Thank you very much for you comments!

Since this article was published more than one year ago, I've just disabled an adding of new comments for this article.