Using Claude Code, Cursor, or another coding agent? Paste this into your prompt to run cross-browser and real-device tests, debug sessions, and wire up CI on the TestMu AI cloud:
window.localStorage: check key existence, values, and item counts.
How Capture Works
localStorage is captured as a point-in-time snapshot when the checkpoint triggers:- On-demand capture: localStorage is read from the current page at the moment the assertion runs
- Current state only: You see exactly what’s in localStorage right now
- Domain-scoped: localStorage is per-origin (protocol + domain + port). You only see data for the current page’s origin
- String values: All localStorage values are strings. If the application stores JSON objects, they’re stored as JSON strings
Planning for Multi-Step Tests
Because localStorage is captured at assertion time:- Assert on localStorage while you’re on the page that set the values. Navigating to a different domain means a different localStorage
- If values are needed later, extract and store them before navigating away
- localStorage persists across steps (unlike network/console) as long as you stay on the same origin