---
title: Selenium IDE variables
description: You can use variables with Selenium IDE. These variables can be used
  in other commands
source_url:
  html: https://testingbot.com/support/web-automate/codeless-automation/variables
  md: https://testingbot.com/support/web-automate/codeless-automation/variables/index.md
---
# Storing Selenium IDE Variables

With Selenium IDE it is possible to `store` variables.   
 These variables can then be used in later commands during the same test flow.

## How to store a variable

To store a variable during a test, please use the `store` command:

    store - javascript(return "test" + Math.floor(Math.random()*11111) + "@test.com") - emailAddress

This example will store a variable called `emailAddress` and its value will be a random `"test....@test.com"` string.

Storing a variable happens in the context of the page. You can use any kind of javascript and reference DOM elements or other functions available on the page. The return value is stored.

## How to use a variable

Once you have stored a variable, you can use it in subsequent steps like this: `${emailAddress}`

## Examples

Below are some examples on how to [store and use variables](https://www.selenium.dev/selenium-ide/docs/en/api/commands#store).

    storeText("css=.container:nth-child(1) > span:nth-child(3)","myVar")

This will store the text from element with CSS selector `.container:nth-child(1) > span:nth-child(3)` in a variable called `myVar`.

    type('id=inputField','${myVar}')

This will type the text stored in the `myVar` variable to an element with `ID=inputField`

Was this page helpful? Yes No 

## Looking for More Help?

Have questions or need more information?   
 You can reach us via the following channels:

- [Email us](https://testingbot.com/contact/new)
- [Join our Slack Channel](https://join.slack.com/t/testingb0t/shared_invite/zt-3bcw9xch-jk19~6XPs_xBrsAgAedkCw)
