The Browser/localStorageSet extension stores a value in the browser's localStorage using a provided key.
This is useful when a journey needs to prepare browser-side state before later steps read it, such as storing an authentication code, feature flag, test value, or application setting that the system under test reads from local storage.
Parameters:
-
keyrequired, a string key to use when storing the value inlocalStorage; -
valuerequired, the string value to store against the suppliedkey. BrowserlocalStoragestores values as strings, so non-string values should be converted before use if a specific format is required;
Note: The value is stored for the current browser origin. A value set on one domain, protocol, or port is not available to a different origin.
How to apply this to your journey
Use the extension in a journey by calling Browser/localStorageSet with the execute command. Pass each value to the matching extension input using as key and as value.
Note: This extension does not return a meaningful value. Use Browser/localStorageGet or an application assertion after this step when you need to confirm the stored value.
execute "Browser/localStorageSet" using "Test" as key and "This is the value" as valueexecute "Browser/localStorageSet" using "authcode" as key and "475923" as valueYou can also pass Virtuoso variables into the extension.
execute "Browser/localStorageSet" using "$storageKey" as key and "$storageValue" as valuestore value "authcode" in $storageKey
store value "475923" in $storageValue
execute "Browser/localStorageSet" using "$storageKey" as key and "$storageValue" as valueThis extension writes to browser local storage and does not return a response value.
This extension does not require any external resource.
The extension should be configured as:
- Run asynchronously: No
- Scope: Global
Limitation: This extension writes only to the localStorage area available to the current browser origin and current journey execution context. It cannot set storage for a different domain unless the journey first navigates to that origin, and browser privacy settings, storage partitioning, private browsing modes, blocked storage, or restricted iframe contexts can prevent or isolate local storage access. Because the implementation directly calls localStorage.setItem(key, value), missing or unintended key and value inputs can overwrite an existing key or store an unexpected string value. Avoid storing secrets, tokens, or sensitive personal data unless the journey design explicitly requires it, because stored values may be visible to page JavaScript running on the same origin during the test. Cross-browser note: This extension uses the standard Web Storage API, but storage behavior can differ across browsers, mobile devices, private browsing, third-party iframe contexts, and remote-grid executions. Validate it in each browser/device configuration used by your plan when the stored value is required by later steps.
Add the extension to your Virtuoso instance
Select the domain that matches your Virtuoso account.
View source
Last updated: 04/06/2026
Resources:
This extension does not require any external resource.
// Note this extension is not a product feature of Virtuoso and is not officially supported
// Extensions use javascript which may or may not be compatible with systems under test (SUTs)
// We welcome you to use this extension or adapt it for your needs
// Instructions:
// This extension allows you to pass in a value to store in the browser local storage
// Write a step localStorageSet (key, value)
// key in this case will be the variable name e.g. authcode
// value will be the value you want to store e.g. 475923
localStorage.setItem(key, value);
inpust are key and value
Comments
0 comments
Please sign in to leave a comment.