Delete local storage
The Delete local storage step allows you to remove data stored in the browser’s local storage during your automation.
Local storage is commonly used by applications to persist information across sessions, such as feature flags, user preferences, cached configuration, or experiment assignments. While useful in production, leftover data can interfere with clean and predictable testing.
This step gives you full control over that state.
Remove exactly what you need
You can choose to:
Delete a specific key
Clear all local storage at once
This flexibility allows you to target only the data that matters, rather than resetting everything unnecessarily.
For example, you might:
Remove a feature flag to test a fallback experience
Clear persisted UI preferences
Reset A/B test assignments
Simulate a first-time user
Remove cached data before validating a fresh load
Maintain consistent, reliable tests
Local storage persists across page reloads and browser sessions. If not managed carefully, it can introduce unpredictable behaviour into your automation.
By deliberately clearing or removing specific keys, you:
Avoid state leakage between test cases
Ensure predictable starting conditions
Reduce false positives and inconsistent failures
Keep regression runs stable
This is particularly important in larger test packs where small pieces of retained data can create unexpected side effects.
Works alongside other state controls
Delete local storage pairs well with:
Set local storage
Delete session storage
Set session storage
Browser reload
Authentication and feature flag testing
Together, these steps give you precise control over client-side state, ensuring each test runs exactly as intended.