> For the complete documentation index, see [llms.txt](https://docs.does.qa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.does.qa/test-steps/data/set-localstorage.md).

# Set LocalStorage

Set LocalStorage writes a key and value into the browser `localStorage`. Use it to seed client side state before the application reads it.

![Set localStorage Test Step](https://app.does.qa/screenshots/node/data_localStorage_set.png)

## When to use it

* Preload a feature flag or preference before the page script runs.
* Set known test data so the UI opens in a predictable state.
* Pair with [Check LocalStorage](/test-steps/check/check-localstorage.md) to confirm the value persisted.

## Configure

### Basics

| Field         | What to set                                                     |
| ------------- | --------------------------------------------------------------- |
| **Key Name**  | `localStorage` key to write                                     |
| **Key Value** | Value to store as text and/or a [Value](/values/value-store.md) |

### Advanced

| Field              | What to set                                          |
| ------------------ | ---------------------------------------------------- |
| **Status on fail** | [Failed Status](/test-step-options/failed-status.md) |

## Related

* [Check LocalStorage](/test-steps/check/check-localstorage.md)
* [Store localStorage](/test-steps/data/store-localstorage.md)
* [Data](/test-steps/data.md)

**Tags:** `data`, `localStorage`, `set`, `save`, `add`
