Repeat steps over elements or data using Start/End Loop
item
, user
, index
) and reference it as {{vars.<name>}}
{{ ... }}
expression that evaluates to an array/iterable at runtime, e.g. {{vars.items}}
, {{vars.apiResponse.users}}
, or {{[...Array(5).keys()]}}
.{{[...Array(5).keys()]}}
and sets loop variable to index
{{vars.apiResponse.items}}
and sets loop variable to item
item
. Must be a valid identifier.{{vars.item}}
, or whatever name you chose.{{ ... }}
syntax to supply arrays/iterables, e.g., {{vars.users}}
, {{[...Array(5).keys()]}}
{{vars.users.filter(u => u.active)}}
.product-card
card
card
{{vars.users}}
user
#name
with {{vars.user.name}}
#email
with {{vars.user.email}}
{{[...Array(5).keys()]}}
index
data-testid
for element loops to avoid flakinessuser
, row
, card
are better than item1
[]
, result of map
/filter
)[...Array(5).keys()]
yields 0–4