Share this page

# lr.deserialize

String and Parameter Functions

Expands an object to represent its ASCII components. (Java only)

    String lr.deserialize ([String value,]int index , [booleanmethod] );

## Arguments

Name | Comments
--- | ---
value | The string to be used during replay.
index | The zero-based index number of the binary file containing the object data.
Method | If "false", use Java's standard deserialization. (default). If "true", use VuGen's deserialization mechanism. This parameter is optional (default=true)

The lr.deserialize method opens an object to represent its ASCII components. This allows you to manually parameterize the members of the object. Binary files containing the object data are sequentially numbered and saved under the Vuser directory. This function is not programmable. It is generated by VuGen during recording and automatically associated with the applicable binary files.

When you specify a string value, you also specify an index, but not a method. When you specify an index, you also indicate a method, but not a value.

## Return Values

This function returns the value of the specified string or null on error.

## Parameterization

You cannot use standard parameterization for any arguments in this function.

## Example

In the following example, lr.deserialize opens the _string object into ASCII components for parameterization. The data is contained in the first binary file under the Vuser directory (index=0).

Copy code

    public class Actions {
    // Public function: init
          public int init() throws Throwable {
              _string = "java.awt.Point __CURRENT_OBJECT = {" +
                         "int x = #5#" +
                         "int y = #8#" +
              "}";
        java.awt.Point p = (java.awt.Point)lr.deserialize(_string,0);
             map.set_point(p);
          }
    }

    To parameterize the values, use the normal correlation methods. Right-click on the value and choose <span style="font-weight: bold;">Replace with Parameter</span>.

    _string = "java.awt.Point __CURRENT_OBJECT = {" +
                         "int x = #<Param1>#" +
                         "int y = #8#" +

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: