Tuesday, February 25, 2014

lr_eval_string in load Runner

To correlate statements for protocols that do not have specific functions, you can use the C Vuser
correlation functions. These functions can be used for all C-type Vusers, to save a string to a
parameter and retrieve it when required.

lr_eval_string :Replaces all occurrences of a parameter with its current value.
lr_save_string :Saves a null-terminated string to a parameter.
lr_save_var :Saves a variable length string to a parameter.

Using lr_eval_string:

In the following example, lr_eval_string replaces the parameter row_cnt with its current value. This value is sent to the Output window using lr_output_message.

lrd_stmt(Csr1, "select count(*) from employee", -1, 1 /*Deferred*/,
...);
lrd_bind_col(Csr1, 1, =;COUNT_D1, 0, 0);
lrd_exec(Csr1, 0, 0, 0, 0, 0);
lrd_save_col(Csr1, 1, 1, 0, "row_cnt");
lrd_fetch(Csr1, 1, 1, 0, PrintRow2, 0);
lr_output_message("value: %s" , lr_eval_string("The row count is:
"));

No comments: