Variable Values

Description:

A variable may be define with an associated set of values.
They are used by the GENERATE and NEXT commands, which allows the variable to be assigned a value from the list or range, either randomly (using GENERATE) or sequentially (using NEXT). Values may be specified as a list (integer, float and string variables) or as a range (integers and floats only).

Format:

STRING name { value1, value2, value3, ... };
INTEGER name { value1, value2, value3, ... };
INTEGER name { value1 - value2 };
FLOAT name { value1, value2, value3, ... };
FLOAT name { value1 - value2 };

Parameter:

name

The name of the variable. This must be a valid AgileLoad Dataname.

value1, value2, ...

The values to associate with the variable.
The values must be literals and of the same data type as the variable, i.e. integer values for integer variables, float values for float variables and string values for string variables.

The notation { value1 - value2 } define a range. It is a shorthand method for defining a list of adjacent integer or float values.
If the start value is less than the end value, the variable is increased by 1 each time the NEXT command is executed until the end value is reached. If the start value is greater than the end value, the variable is decreased by 1 each time the NEXT command is executed until the end value is reached.

If the variable is set to the end value when the NEXT command is executed, the variable will be reset to the start value. You can also reset the variable explicitly by using the RESET command.

Example:

Integer A {4,3,2,1,0,-1};
Integer B {4 - -1};
Integer C {100 - 999};
Integer D {100,200,300,400};
Float E {0.53,1.20,0.5,4.09};
Float F {1. - 10.};
String Language ("ENGLISH", "FRENCH", "GERMAN", "SPANISH");

See Also:





Go back to the Learning center:


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