Parameter Types

Every parameter is defined by the type of data it contains. This section contains information on the different parameter types.

File Type Parameters

Data files hold data that a Vuser accesses during script execution. Data files can be local or global. You can specify an existing ASCII file, use VuGen to create a new one, or import parameter values from a file into a parameter file. Data files are useful if you have many known values for your parameter.

The data in a data file is stored in the form of a table. One file can contain values for many parameters. Each column holds the data for one parameter. Column breaks are marked by a delimiter, for example, a comma.

In the following example, the data file contains ID numbers and first names:


Note: When working with languages other than English, save the parameter file as a UTF-8 file. In the Parameter Properties window, click Edit with Notepad. In Notepad, save the file as a text file with UTF-8 type encoding.

For details on how to import parameter values from a file, see How to Import Parameter Values from a File.

Back to top

Table Type Parameters

The Table parameter type is meant for applications that you want to test by filling in table cell values. Whereas the file type uses one cell value for each parameter occurrence, the table type uses several rows and columns as parameter values, similar to an array of values. Using the table type, you can fill in an entire table with a single command. This is common in SAP GUI Vusers where the sapgui_table_fill_data function fills the table cells.

For details on how to import parameter values from a file, see How to Import Parameter Values from a File.

Back to top

XML Type Parameters

Used as a placeholder for multiple valued data contained in an XML structure. You can use an XML type parameter to replace the entire structure with a single parameter. For example, an XML parameter called Address can replace a contact name, an address, city, and postal code. Using XML parameters for this type of data allows for cleaner input of the data, and enables cleaner parameterization of Vuser scripts. We recommend that you use XML parameters with Web Service scripts or for SOA services.

Back to top

Internal Data Type Parameters

Internal data is generated automatically while a Vuser runs, such as Date/Time, Group Name, Iteration Number, Load Generator Name, Random Number, Unique Number, and Vuser ID.

  • Custom: You can specify the parameter data type.
  • Date/Time: The current date/time. You can specify the format and the offset in the Parameter Properties dialog box.
  • Group Name: The name of the Vuser Group. If there is no Vuser Group (for example, when running a script from VuGen) the value is always none.

  • Iteration Number: The current iteration number.

  • Load Generator Name: The name of the Vuser script's load generator (the computer on which the Vuser is running).

  • Random Number: A random number within a range of values that you specify.

  • Unique Number: Assigns a range of numbers to be used for each Vuser. You specify the start value and the block size (the amount of unique numbers to set aside for each Vuser). For example, if you specify a start value of 1 and a block size of 100 the first Vuser can use the numbers 1 to 100, the second Vuser can use the numbers 201-300, and so on.

  • Vuser ID: The ID number assigned to the Vuser by the Controller during a scenario run. When you run a script from VuGen, the Vuser ID is always -1.

  • Note: This is not the ID number that appears in the Vuser window—it is a unique ID number generated at runtime.

Back to top

User-Defined Function Parameters

Data that is generated using a function from an external DLL. A user-defined function replaces the parameter with a value returned from a function located in an external DLL.

Before you assign a user-defined function as a parameter, you create the external library (DLL) with the function. The function should have the following format:

__declspec(dllexport) char *<functionName>(char *, char *)

The arguments sent to this function are both NULL.

When you create the library, we recommend that you use the default dynamic library path. That way, you do not have to enter a full path name for the library, but rather, just the library name. VuGen's bin folder is the default dynamic library path. You can add your library to this folder.

The following are examples of user-defined functions:

__declspec(dllexport) char *UF_GetVersion(char *x1, char *x2) {return "Ver2.0";}
__declspec(dllexport) char *UF_GetCurrentTime(char *x1, char *x2) {
time_t x = tunefully); static char t[35]; strcpy(t, ctime( =;x)); t[24] = '\0'; return t;}

Back to top