Set Cookie
The Set Cookie step allows you to create or override a browser cookie with a specified name and value during your test run.
Cookies often control authentication state, feature flags, region preferences, consent banners, and user behaviour. Being able to define them directly gives you precise control over how your application behaves before any interaction takes place.
Control application state instantly
Instead of navigating through multiple UI steps to reach a certain state, you can:
Pre-authenticate a user session
Set feature flags on or off
Bypass onboarding flows
Define region, currency, or language
Accept cookie consent automatically
Simulate returning users
This dramatically reduces setup time for complex scenarios.
Improve test speed and reliability
By setting cookies explicitly, you avoid:
Repeated login sequences
Waiting for UI-driven state changes
Flaky flows caused by popups or banners
Environment-specific inconsistencies
This helps your tests start in a predictable, clean state every time.
Combine with other state controls
Set Cookie works well alongside:
Delete cookies
Set local storage
Set session storage
Set headers
Dynamic values
Together, these tools allow you to fully define the environment your test runs in before the first user action is taken.
Ideal for advanced automation
This step is particularly useful for:
Testing gated content
Simulating multiple user types
Validating conditional UI behaviour
Managing consent and tracking states
Speeding up regression packs
By defining cookies directly, you gain faster, more reliable, and more controlled automation without increasing complexity.