Correlation Functions - Java Vuser Scripts

To correlate statements for Java Vusers, you can use the Java Vuser correlation functions for all Java type Vusers. This lets you save a string to a parameter and retrieve it when required.


lr.eval_string
Replaces a parameter with its current value.
lr.eval_data
Replaces a parameter with a byte value.
lr.eval_int
Replaces a parameter with an integer value.
lr.eval_string
Replaces a parameter with a string.
lr.save_data
Saves a byte as a parameter.
lr.save_int
Saves an integer as a parameter.
lr.save_string
Saves a null-terminated string to a parameter.

When recording a CORBA or RMI session, VuGen performs correlation internally. For more information, see How to Correlate Scripts - Java.

Using the Java String Functions

When programming Java Vuser scripts, you can use the Java Vuser string functions to correlate your scripts. In the following example, lr.eval_int substitutes the variable ID_num with its value, defined at an earlier point in the script.

lr.message(" Track Stock: " + lr.eval_int(ID_num));

In the following example, lr.save_string assigns John Doe to the parameter Student. This parameter is then used in an output message.

lr.save_string("John Doe", "Student");
// ...
lr.message("Get report card for " + lr.eval_string("<Student>"));
classroom.getReportCard

Back to top