Skip to content

Integer Incrementer

formatting...

Unique incremented 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

Name Type Description Default
step int how much the value should increment each time 1
persist bool if the initial value should be persist and loaded from file False

Example

example.feature
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:

  1. Run

    1. 100

    2. 110

    3. 120

    4. ...

  2. Run

    1. 100

    2. 110

    3. 120

    4. ...

Values of AtomicIntegerIncrementer.persistent, per run and iteration, for 4 iterations:

  1. Run (features/persistent/example.json missing)

    1. 5

    2. 15

    3. 20

    4. 25

  2. Run (features/persistent/example.json created by Run 1, due to persistent=True), initial value 25 | step=5, persist=True will be read from the file and override what is written in example.feature

    1. 30

    2. 35

    3. 40

    4. 45