Set local storage
The Set local storage step allows you to define a browser local storage key and value directly within your test.
Local storage is widely used by modern web applications to persist information such as feature flags, user preferences, tokens, onboarding state, and experiment assignments. By setting local storage deliberately, you can control application behaviour without relying on UI interactions.
This gives you a faster and more reliable way to prepare test conditions.
Control application state instantly
Instead of navigating through multiple screens to trigger a specific state, you can inject it directly.
Common use cases include:
Enabling or disabling feature flags
Simulating a returning user experience
Skipping onboarding flows
Pre-setting language or region preferences
Injecting test configuration values
Simulating A/B test assignments
This approach reduces test steps, speeds up execution, and keeps flows focused on what truly matters.
Improve performance and reduce duplication
Setting local storage early in a test can eliminate unnecessary navigation and repetitive setup actions.
This helps:
Reduce test complexity
Speed up regression packs
Avoid brittle setup flows
Keep branching structures cleaner
It is particularly powerful in combination with value store variables, allowing you to dynamically set different storage values based on environment, CI/CD inputs, or recipe configurations.
Works seamlessly with other state controls
The Set local storage step pairs well with:
Delete local storage
Session storage controls
Branching
Recipes and CI/CD value overrides
Together, these tools allow you to shape browser state precisely, giving you full control over how your application behaves during automation.