---
title: Configurations & variables
description: >-
  Learn how to create simple variables and variable groups in Kapptivate to
  reuse values like credentials and profiles across tests.
sidebarTitle: Configuration & Variables
lastUpdated: "2026-09-09"
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

Hardcoding identifiers, passwords, or email addresses into each test makes scenarios brittle and hard to maintain. Variables let you store those values once and reuse them everywhere, so a single change updates every test that depends on it. Kapptivate organizes them in two ways: **simple variables** with one global value, and **variable groups** that hold different values per variant.

Variables live in a product space. The Configurations page lists them all in a table showing each variable's name, value, and `Usage`, the tests that currently reference it.

## Simple variables

A simple variable belongs to a product space and holds a single value used everywhere it's referenced. Pick a variable type when you create it.

<Tabs>
  <Tab title="Single value">
    A fixed value (text, number, key) that doesn't change. Use it for things like a client ID or a public key.
  </Tab>
  <Tab title="Secret">
    For sensitive data such as passwords or API tokens. The value is encoded in both the UI and the database.

    Once saved, the value is **never shown again**. To change it, the field appears empty and you must re-enter the full new value to overwrite the old one.
  </Tab>
  <Tab title="Choice">
    A predefined list of values (Choice 1, Choice 2, Choice 3…). Whoever uses the variable picks one of the options.
  </Tab>
</Tabs>

**Create a simple variable:**

<Steps>
  <Step title="Open the creation form">
    Click **Create variable**.
  </Step>
  <Step title="Name it">
    Enter a name with no spaces or special characters.
  </Step>
  <Step title="Choose a type">
    Select **Single value**, **Secret**, or **Choice**.
  </Step>
  <Step title="Describe it">
    Add a description. Optional, but recommended so teammates know what the variable is for.
  </Step>
  <Step title="Set the value">
    Enter the value, or the list of values for a Choice variable, then click **Create**.
  </Step>
</Steps>

## Variable groups and variants

A variable group bundles several variables under one entity and gives each one a different value per **variant**. Switching the variant swaps every value in the group at once.

This is ideal for distinct user profiles, separate environments (staging, production), or complex test datasets. For example, a `User Profiles` group with variants *Alexandre*, *Marc*, and *Julie* lets you run the same scenario as a different person without touching the test.

**Create a variable group:**

<Steps>
  <Step title="Open the group form">
    Click **Create variable group**.
  </Step>
  <Step title="Name the group">
    For example, `User Profiles`.
  </Step>
  <Step title="Define the variants">
    Add each variant: for user profiles that might be *Alexandre*, *Marc*, *Julie*. Mark one as the `Default`.
  </Step>
  <Step title="Add variables">
    Add the variables the group needs, such as `email` and `password`.
  </Step>
  <Step title="Set a value per variant">
    For each variable, fill in the value for every variant. For `email`: Alexandre → `alexandre@mail.com`, Marc → `marc@mail.com`.
  </Step>
</Steps>

Switching variants from the group's dropdown updates all of its values at once to reflect the selected profile.

## Using variables in tests

Once your variables are set up, inject them straight into your test steps.

**Inject a variable into a step:**

<Steps>
  <Step title="Open the variable picker">
    While creating or editing a step (a **Click** action, a text entry, etc.), click the `{}` icon next to the target field.
  </Step>
  <Step title="Go to the Variables tab">
    The picker also offers values from previous steps and random generators; your configured variables live in the **Variables** tab. See [Variables in tests](/tests/variables) for the full picker.
  </Step>
  <Step title="Pick the variable">
    Browse the tree (for example `User Profiles` > `email`) and select the variable to insert it into the step.
  </Step>
</Steps>

### Switch variant while configuring the test

In the test editor's side panel, the **Environment** tab lists your variable groups. Use the dropdown to change the variant the test uses. Switch from *Alexandre* to *Marc* and the test runs with Marc's data.

### Switch variant at run time

On the final **Run confirmation** screen, Kapptivate shows the variables the run will use. This is your last chance to change the variant from a dropdown, so you can run the same scenario with a completely different profile or dataset on the fly.

## Search and manage

The Configurations page keeps every variable and group in one place.

- **Search**: Find variables and groups by name
- **Usage tracking**: See which tests depend on a variable before you change it
- **Duplicate**: Clone a variable to create a similar one
- **Delete**: Remove a variable or variable group
