Skip to content

Storage Steps

Source: src/tests/steps/actions/store.step.ts.

See shared placeholder rules in Step Parameter Conventions.

Signature: the user stores the {string} element text inside the variable {string}

What it does:

  • Resolves locator.
  • Reads textContent().
  • Stores value in runtime variable map.

Parameters:

ParameterRepresentsExpected data
First {string}Element locator nameExisting locator key (for example orderIdLabel).
Second {string}Target variable keyNew/existing variable name (for example capturedOrderId).

Example:

When the user stores the "orderIdLabel" element text inside the variable "capturedOrderId"

Signature: the user stores the {string} text input value inside the variable {string}

What it does:

  • Resolves input locator.
  • Reads inputValue().
  • Stores into runtime variable.

Parameters:

ParameterRepresentsExpected data
First {string}Input locator nameExisting locator key (for example emailInput).
Second {string}Target variable keyNew/existing variable name (for example savedEmail).

Example:

When the user stores the "emailInput" text input value inside the variable "savedEmail"

Signature: the user stores the {string} textarea input value inside the variable {string}

What it does:

  • Resolves textarea locator.
  • Reads inputValue().
  • Stores into runtime variable.

Parameters:

ParameterRepresentsExpected data
First {string}Textarea locator nameExisting locator key (for example notesTextarea).
Second {string}Target variable keyNew/existing variable name (for example savedNotes).

Example:

When the user stores the "notesTextarea" textarea input value inside the variable "savedNotes"
  • Step fails when locator cannot be resolved.
  • Stored values are only available within the current scenario world context.