storedVars... - Selenium IDE command

storedVars gives you access to the stored variables within a JavaScript snippet. Inside storeEval you can access the value of a variable with the ${T1} notation. But if you want to use the variable itself (e. g. as in storedVars['T1'].toUpperCase()), then use the storedVars notation. StoredVars in the Kantu Selenium IDE works the same as in the Firefox IDE, even so internally the implementation is different.

storedVars Screencast

This video shows a real life use case of storedVars to access values from an array. In the demo we store the names of the breadcrumbs (A,B,...) in the array, and then loop over the array to access each page:

storedVars Example

The result of this macro is that CCC will contain 75 and T2 will contain "SELENIUM IDE" all in caps.

Command Target Pattern/Text
store AAA 100
store BBB 25
storeEval storedVars['AAA']-storedVars['BBB'] CCC
store SeLeniUM iDE T1
storeEval storedVars['T1'].toUpperCase() T2

Works in

Kantu for Chrome Selenium IDE, Firefox IDE Classic

Related Demo Macros


The ready-to-import-and-run source code of all demo macros can be found in the Github repository testmacros folder.

See also

storeEval, store, Web Automation Extension User Manual, Selenium IDE commands, Classic Firefox Selenium IDE.

Anything wrong or missing on this page? Suggestions?

...then please contact us.

Kantu Selenium IDE for Chrome and Firefox - Web Test Automation
Subscribe to the a9t9 automation software newsletter . We'll send you updates on new releases that we're working on.