Integer Incrementer
This variable provides an unique integer each time it is accessed.
Useful to generate unique ID for each request.
Format
The first value of an integer that is going to be used.
Arguments
-
step
int, (optional) - how much the value should increment each time (default1
) -
persist
bool, (optional) - if the initial value should be persist and loaded from file (defaultFalse
)
Example
And value for variable "AtomicIntegerIncrementer.unique_id" is "100 | step=10"
And value for variable "AtomicIntegerIncrementer.persistent" is "10 | step=5, persist=True"
This can then be used in a template:
{
"id": {{ AtomicIntegerIncrementer.unique_id }}
}
Values of AtomicIntegerIncrementer.unique_id
, per run and iteration:
-
Run
-
100
-
110
-
120
-
...
-
Run
-
100
-
110
-
120
-
...
Values of AtomicIntegerIncrementer.persistent
, per run and iteration:
-
Run (
features/persistent/example.json
missing) -
5
-
15
-
20
-
...
-
Run (
features/persistent/example.json
created by Run 1, due topersistent=True
), initial value35 | step=5, persist=True
will be read from the file and override what is written inexample.feature
-
25
-
30
-
35
-
...
atomicintegerincrementer__base_type__
def atomicintegerincrementer__base_type__(value: Union[str, int]) -> str
Validate values that AtomicRandomInteger
can be initialized with.