Reset Command

Description:

This command clears a list of variables. In the case of variables associated with a list or range of values, the variable's seed may be reset to a specified value.

Format:

Reset listVariable;
Reset listVariable Seed=seedValue;

Parameters:

listVariable

A comma separated list of variable names to reset.

seedValue

An integer literal defining the new seed value for the variables.
If the "SEED" clause is omitted from the RESET command, the seed variable will be reset to the value specified when the variable was defined, or to the value specified by a previous RESET command.

Example:

integer iRangeVar {1-100} seed = 25;

// The initial value for a range variable is the start value (1)
log "iRangeVar = " + ToString(iRangeVar);

// Load a random value into iRangeVar
Generate iRangeVar;
log "iRangeVar = " + ToString(iRangeVar);

// Reset iRangeVar without specifying a new seed, this command reinitialize iRangeVar to 1 and keep the old seed (25)
Reset iRangeVar;
log "iRangeVar = " + ToString(iRangeVar);

// Load a random value into iRangeVar, the seed was not changed, this command will generate the same value as last call
Generate iRangeVar;
log "iRangeVar = " + ToString(iRangeVar);

// Reset iRangeVar with a new seed, this command reinitialize iRangeVar to 1 and set the seed to 12
Reset iRangeVar Seed = 12;
log "iRangeVar = " + ToString(iRangeVar);

// Load a random value into iRangeVar, the seed was changed, this command will generate a different value than last call
Generate iRangeVar;
log "iRangeVar = " + ToString(iRangeVar);

Output:

iRangeVar = 1
iRangeVar = 88
iRangeVar = 1
iRangeVar = 88
iRangeVar = 1
iRangeVar = 16





Go back to the Learning center:


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