Parameterizing Virtual User Scripts

The data within data sources is accessed by virtual users (VUs) via the VU methods available within the various Data Dictionary APIs.

C++ DataDictionary API

Parameterizing Virtual User Script Code

Parameterization, whether automatic or manual, results in method calls from the aforementioned APIs being inserted into script code.

Note: No matter what type of data source is being accessed (other that custom data files), the method calls are exactly the same.

Example Parameterization Code

The following code examples demonstrate how an integer and a string (text) can be retrieved from a data source. All of these examples work whatever the data source type (custom data files excluded).

C++

// original recorded values in a Web Virtual User Script

// original recorded values in a Web Virtual User Script

_formData_52_0_1.setValue("fullName", "Martin Petrov");

_formData_52_0_1.setValue("password", "p@ssw0rd1");

_formData_52_0_1.setValue("username", "Martin");

 

// parameterized values

_formData_52_0_1.setValue("fullName", getString("custForename") + " " + getString("custSurname"));

_formData_52_0_1.setValue("password", getString("custPassword"));

_formData_52_0_1.setValue("username", getString("custForename"));

 

 

This topic was last updated on 2月 01, 2019, at 11:13:24 午前.

Eggplant icon Eggplant.io | Documentation Home | User Forums | Support | Copyright © 2019 Eggplant