Generate Command

Description:

This command loads a random value from a set of values into variables.

Format:

Generate listVariables;

Parameters:

listVariables

A comma separated list of variable names into which the generated values are to be loaded.
The variables must have been declared with an associated list or range of values. If a seed value is used in the variable declaration, values will be retrieved in the same random order on every run. otherwise values will be retrieved in different random sequences on every run.

Example:

integer iRangeVar {1-100} seed = 25;
integer iListVar {0,10,20,30,40};
integer iFileVar file="IntValues";

// This command will load the same value in iRangeVar each time the script is run because a seed was associated with iRangeVar
Generate iRangeVar;
log "iRangeVar = " + ToString(iRangeVar);

// Load 0,10,20,30 or 40 in iListVar
Generate iListVar;
log "iListVar = " + ToString(iListVar);

// Load a value from file "IntValues" in iFileVar
Generate iFileVar;
log "iFileVar = " + ToString(iFileVar);

// Generate random values for multiple variables in a single call
Generate iRangeVar, iListVar, iFileVar;

Output:

iRangeVar = 88
iListVar = 40
iFileVar = 12





Go back to the Learning center:


Copyright © AgileLoad. All rights reserved.
Agile Load testing tool| Contact AgileLoad | Terms of Use | Sitemap