Memory
Memory is a durable store that lives across runs of the same test, keyed by a name you pick. Use it for values that are expensive to set up and cheap to reuse: auth tokens, created entity IDs, seeded data.
yaml
- memory:
action: get
key: admin_token
as: token
- conditional:
if: "{{ !var.token }}"
then:
- navigate: /admin/login
- click: sign in with SSO
- javascript:
code: return localStorage.getItem('token')
as: fresh_token
- memory:
action: set
key: admin_token
value: "{{ var.fresh_token }}"Memory is not a secret store
Treat memory as cache, not vault. For credentials and API keys, use secrets instead.