Set variable in a web test

Define a value once and reuse it across a web test: a generated username, a constant, or a value built from other variables.

Define a value once and reuse it across the test: a username generated at the start of the run, a constant you don't want to repeat, a value built from other variables.

Parameters

ParameterRequiredDescription
Variable nameYesName of the variable to create or overwrite.
ValueYesThe value to store. Supports text, other variables, and functions like random text.

Results and metrics

  • Variable: available to every later step of the test. Insert it anywhere a field supports variables.
  • Timing and status: recorded in the step result like any other step.

See Variables for variable types and the functions you can use in values.

What's next?

Extract value

Capture a value from the page instead of defining it

Variables

Test variables, global variables, and functions

Last updated on