Is there a way to keep your stored variables in Selenium IDE between sessions.

After closing Selenium and restarting Selenium IDE I lose my saved variables


In general it would be advisable to step back from Selenium IDE and move to Selenium Webdriver if you want to work with variables.

From the Selenium HQ website, if you want to:

  • create quick bug reproduction scripts
  • create scripts to aid in automation-aided exploratory testing

you should use SeleniumIDE.

Anything more complex than this you are to use Selenium Webdriver. To be able to use webdriver, you will have to learn how to use a programming language that will manage the variables and so on, while Selenium is there to talk to the browser.


Basically NO. Selenium IDE works in the browser. Once it is restarted, IDE is in zero state. There is no possibility to store some variable outside of it, due to security reasons.

I can imagine some obscure way to inject values or part of HTML to separate page / in a separate window, which is not closed during IDE restart. But when you close the browser window, everything is completely lost.

Better would be to explain, what you want to reach by this.


Bit hackish, but you could try to open a new window in which you load a web application (e.g. a simple todo-list application) that you can store data in.

In your run after closing you could retrieve the text entry from the todo-list as data for your variable.

If you build the website to store the data yourself it could be even more easy doable.


Absolutely you can, and I have, stored variables in seleniumIDE that are available for all sessions.

Details at http://www.seleniumhq.org/docs/02_selenium_ide.jsp#store-commands-and-selenium-variables

Use store and ${name} to access them.

I'm assuming that you are not talking about dynamic variables that are only created during a run and then stored by selenium somewhere else and then available. That's a more advanced topic and not what you are asking from the content of your question.

I'm also assuming you are not talking about some global variables that are available to all scripts. However you can also store all the selenium variables in an external file that is then used by multiple scripts in case you are looking for that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.