set local storage
Write a key/value pair into the current page localStorage
Write a key/value pair into the current page's localStorage via an engine-internal page evaluate (not a general run js command — no such command exists).
Syntax
When I set local storage "<key>" to "<value>"Qualifiers
| Qualifier | Role | Example |
|---|---|---|
to | Storage value | set local storage "token" to "abc" |
Requirements
| Item | Contract |
|---|---|
| Element / control shape | None — localStorage key/value on current origin |
| How the label binds | Key + value payloads |
| Qualifiers that change resolve | to |
| Platform | Web only (navigate first) |
| Wrong shape → use instead | sessionStorage → set session storage |
See also UI contracts.
Examples
Given I navigate to "https://example.com"
When I set local storage "token" to "abc123"Notes
- Requires a loaded page (navigate first).
- Quoted values resolve like every other step (
$ENV,@/@@). Reports keep the raw.stkquote. - Web only. Appium /
Platform: apireturn unsupported.