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.

Replaces a parameter with its current value.
Replaces a parameter with a byte value.
Replaces a parameter with an integer value.
Replaces a parameter with a string.
Saves a byte as a parameter.
Saves an integer as a parameter.
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>"));

Back to top