Create a Vuser Script Record a Vuser Script Replay a Vuser Script Use Correlation Studio Debug a Vuser Script Insert Transactions into a Vuser Script View Replay Summary Tab

Parameterization Overview

When you record a business process, VuGen generates a script that contains the actual values used during recording. Suppose you want to perform the script's actions (query, submit, and so forth) using different values from those recorded. To do this, you replace the recorded values with parameters. This is known as parameterizing the script.

The resulting Vusers substitute the parameter with values from a data source that you specify. The data source can be either a file, or internally generated variables. For details, see Parameter Types.

Delimiters

Parameters appear inside a Vuser script within parameter delimiters. By default, VuGen uses "{" and "}" as the left and right parameter delimiters, but you can modify these delimiters if required. In addition, you can modify the background color and outline color of parameters in a script. For details, see Scripting Options Tab.

 

Script section as recorded.

"value=UNIX"

Script section after "UNIX" has been replaced with the "Operating System" parameter.

"value={Operating System}"

Back to top

Input/Output parameters

You can parameterize only the arguments within a function. You cannot parameterize text strings that are not function arguments. In addition, not all function arguments can be parameterized. For details on which arguments you can parameterize, see the Function Reference for each function.

Input parameters are parameters whose values you define in the design stage before running the script. Output parameters you define during design stage, but they acquire values during test execution. Output parameters are often used with Web Service calls. Use care when selecting a parameter for your script during design stage, make sure that it is not an empty Output parameter.

 

Let's say you recorded a Vuser script while operating a Web application. VuGen generated the following statement that searches a library's database for the title "UNIX":

 web_submit_form("db2net.exe",
        ITEMDATA,
        "name=library.TITLE",
         "value=UNIX",
        ENDITEM,
        "name=library.AUTHOR",
        "value=",
        ENDITEM,
        "name=library.SUBJECT",
        "value=",
        ENDITEM,
        LAST);

When you replay the script using multiple Vusers and iterations, you do not want to repeatedly use the same value, UNIX. Instead, you replace the constant value with a parameter:

web_submit_form("db2net.exe",
        ITEMDATA,
        "name=library.TITLE",
         "value={Book_Title}",
        ENDITEM,
        "name=library.AUTHOR",
        "value=",
        ENDITEM,
        "name=library.SUBJECT",
        "value=",
        ENDITEM,
        LAST);

For task details, see How to Create Parameters.

Back to top

Correlation

To enable some recorded Vuser scripts to replay correctly, it may be necessary to implement correlation. Correlation is used when a recorded script includes a dynamic value (such as a session ID) and therefore cannot be successfully replayed. To resolve this, you convert the dynamic value into a variable—thereby enabling your script to replay successfully. For details, see Correlation Overview.

Back to top

VTS and Parameterization

VTS (Virtual Table Server) is a web-based application that works with Vuser scripts. VTS offers an alternative to standard VuGen parameterization.

When you use standard parameterization, each Vuser is assigned parameter values from a dedicated set of values - parameter values are not shared between Vusers. In contrast, VTS enables you to assign parameter values from a single set of parameter values to multiple Vusers. This may enable you to more accurately emulate a real-user environment.

VTS is composed of two components, VTS-Client and VTS-Server. VTS-Client is a set of API functions that are used to access data in VTS-Server. Because the VTS API functions integrate with VuGen, there is no need to install VTS-Client. VTS-Server includes a table that contains parameter values that can be used by your Vuser scripts. The VTS table is composed of columns and rows. Each column represents a set of values that can be assigned to a specific parameter in your Vuser scripts. The cells within a column contain the actual values that are assigned to the parameter.

Note: Significant changes were made to VTS in LoadRunner version 11.52. When upgrading to VTS 11.52 or later, these changes may result in various compatibility issues. For details on script modifications that are required in order to resolve these compatibility issues, see the VTS documentation that is available from the VTS > Help menu.

To install VTS:

Locate the setup file in the Additional Components folder of the installation media. After installing the VTS server, you can access further information from the VTS > Help menu. For details, see Installing the Virtual Table Server (VTS).

For details on how to use VTS functionality in TruClient Vuser scripts, see the TruClient Help Center (select the relevant version).

Back to top