> ## Documentation Index
> Fetch the complete documentation index at: https://docs.testdriver.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# remember

> Save a variable to use later.

<div className="replay-block">
  <iframe src="https://app.testdriver.ai/replay/689e0823baa4b0a85b4ca387?share=DMgGQIjQnlFlW7fAr4J4QQ&embed=true&timestamp=90000&playbackRate=5" width="1000" height="350" />
</div>

```yaml testdriver/remember.yaml highlight={5-7, 17, 18} theme={null}
version: 6.0.0
steps:
  - prompt: focus chrome, remember the password, enter the username and the remembered password and login
    commands:
      - command: remember
        description: the password
        output: my_password
      - command: hover-text
        text: Username
        description: username input field
        action: click
      - command: type
        text: standard_user
      - command: press-keys
        keys:
          - tab
      - command: type
        text: ${OUTPUT.my_password}
      - command: press-keys
        keys:
          - tab
      - command: press-keys
        keys:
          - enter
      - command: assert
        expect: the homepage is visible
```

## Description

The `remember` command is used to save a variable for later use. This is useful for storing values that you want to reference in subsequent commands or steps, **especially for things that are dynamic or change frequently from run to run**.

## Arguments

|    Argument   |   Type   | Description                                               |
| :-----------: | :------: | :-------------------------------------------------------- |
|    `output`   | `string` | The variable name you will use to recall the value later. |
| `description` | `string` | A prompt describing the value you want to store.          |

***

## Example usage

```yaml theme={null}
- command: remember
  description: The date value shown to the right of 'Order Date'
  output: my_variable
```

## Protips

* Use the output later with this syntax `${OUTPUT.my_variable}`.
* The `remember` command does not persist variables across different test runs. If you need to store values for later use in different test runs, consider using external storage solutions or environment variables.
* For now, the `remember` command only supports string values. If you need to store complex data types, you may use `remember` multiple times for the values. This may change in a later version.

## Gotchas

* Ensure the variable name is unique to avoid overwriting existing variables.
* The variable name is case-sensitive, so `my_variable` and `My_Variable` would be treated as different variables.

## Notes

* The `remember` command is ideal for storing values that are generated during the test run, such as timestamps, IDs, the text value of a link you might click later, or any other dynamic data.
