Skip to content

Commit

Permalink
extract multiple variables
Browse files Browse the repository at this point in the history
  • Loading branch information
aliciascott committed Oct 28, 2024
1 parent 86ccd54 commit 93c613d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions content/en/synthetics/browser_tests/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,18 @@ If a variable is assigned different values along your browser test steps (for ex

Some variables only compute at runtime, such as a variable from an HTTP request or a JavaScript step. For example, assume you have a `Type text` step featuring `{{ <YOUR_VARIABLE_NAME> }}`. At test execution, `{{ <YOUR_VARIABLE_NAME> }}` is systematically replaced by your variable's associated value. To record a step using one of these variables, record a step with the actual variable value, and replace the actual value with `{{ <YOUR_VARIABLE_NAME> }}` in the step's definition before saving your test.

### Use multiple variables

Additionally, you can add multiple variables to your browser test recording steps.

In your browser test recording, click the **+ Add Variable** button to add one or more variables to your test:

{{< img src="synthetics/browser_tests/extract_multiple_variables.png" alt="Defining a local variable from global variables" width="90%" >}}

In your browser test's recorder, add a step recording, and click **Extract variables from the response(optional)** to extract and use the variables in your browser test:

Check notice on line 483 in content/en/synthetics/browser_tests/actions.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.sentencelength

Suggestion: Try to keep your sentence length to 25 words or fewer.

{{< img src="synthetics/browser_tests/edit_test_extract_multiple_variables.png" alt="Injecting a local variable into a field during a browser recording" width="90%" >}}

## Edit a recording

To edit a browser recording after it's saved:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 93c613d

Please sign in to comment.