- Select the text you want to parametrize, right click and select replace with parameter
- Choose the parameter name (Please follow a standard naming convention) and parameter file type (which we will discuss in detail later). For now choose file.
- You can successfully parametrized the value in the script
- Open parameters list, click edit with notepad, enter multiple different values
- Now run the script, and you can observe that script uses different values for each iteration
You cannot parameterize text strings that are not function arguments.
You cannot parameterize all function arguments.
- File or Table parameter types
- User Defined Parameter types
- Internal type Parameter types
File or Table Parameter types:
This is the very common method for using parameters in Vugen. Vugen fetches data from external file or data table. We can edit/open this file using notepad. You can also use data wizard to fetch data from database. We can also create new file for storing the data. Vugen access this file during the script execution. One data file can contain multiple columns (each column equivalent to one parameter), and under each columns you have different values. Comma, Tab, Space suffice the job of column delimiters. In the below example a new data file created contains number, firstname, lastname
Number FirstName LastName
1 mm kk
2 00 pp
3 dd ss
User Defined Parameter types:
An external DLL is loaded and data is generated using a function from this 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 *(char *, char *)
Internal type Parameter types:
Data is generated automatically and used for the parameter. For eg if u define data/time then today’s data is used for the parameter (today’s date is replaced for the parameter in the script when the Vuser runs). The other different internal type parameters are : Group name, Iteration number, Load generator Name, random number, Unique Number and Vuser Id. If you choose random as parameter type then for each iteration a random value is substituted in the script during execution. You can choose the max and min value range.
Using Existing Parameters
Paramater is automatically added to the parameter list whenever you create a new parameter. You can use this existing parameter to replace any value in the script or to replace multiple occurrences of that value. Restoring Original StringsYou can also restore original value after undoing the parameterizationTo restore a parameter to its original value:In Script view, right-click on the parameter and select Restore original value. Paramater List:Here You can create new paramaters, edit paramaters, delete parameters, edit parameter values, choose parameter types, set/edit parameter properties, choose data assignment method, data update modes,

No comments:
Post a Comment