From cfaa50e8106c565b5ea2b1967514397fddc516c9 Mon Sep 17 00:00:00 2001 From: Sami Taider Date: Thu, 21 May 2026 14:27:55 +0200 Subject: [PATCH 1/3] [SYNTH-26796] Document JS assertion truncation in Privacy option Document that the 'Do not save response body' Privacy option on HTTP API tests also truncates the error message of failed JavaScript assertions. Align the bullet wording with the equivalent precedent on the browser and mobile test pages. --- content/en/synthetics/api_tests/http_tests.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/en/synthetics/api_tests/http_tests.md b/content/en/synthetics/api_tests/http_tests.md index 3227b8c7038..eb474b2c4a7 100644 --- a/content/en/synthetics/api_tests/http_tests.md +++ b/content/en/synthetics/api_tests/http_tests.md @@ -125,7 +125,7 @@ You may create a test using one of the following options: {{% tab "Privacy" %}} - * **Do not save response body**: Select this option to prevent response body from being saved at runtime. This can be helpful to ensure no sensitive data gets featured in your test results. Use mindfully as it can make failures troubleshooting more difficult. For more security recommendations, see [Synthetic Monitoring Security][1]. + * **Do not save response body**: Select this option to prevent the response body from being saved at runtime and to truncate the error message of failed JavaScript assertions. This helps ensure no sensitive data is displayed in your test results, but it can make failure troubleshooting more difficult. For full security recommendations, see [Synthetic Monitoring Data Security][1]. [1]: /data_security/synthetics @@ -188,6 +188,8 @@ Use JavaScript assertions when standard response assertions don't meet your vali
JavaScript capabilities are not supported for API tests in Windows private locations.
+**Note:** If a failed JavaScript assertion's error message might include sensitive data, enable **Do not save response body** under **Advanced Options** > **Privacy**. This truncates the assertion error message. + #### Using dd.assert() Use `dd.assert()` for traditional assertion syntax: From 60995269d3bcfbc3d61dec2346a85d4deb0bc6e9 Mon Sep 17 00:00:00 2001 From: Sami Taider Date: Thu, 21 May 2026 18:13:23 +0200 Subject: [PATCH 2/3] Update content/en/synthetics/api_tests/http_tests.md Co-authored-by: Janine Chan <64388808+janine-c@users.noreply.github.com> --- content/en/synthetics/api_tests/http_tests.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/content/en/synthetics/api_tests/http_tests.md b/content/en/synthetics/api_tests/http_tests.md index eb474b2c4a7..eb8eb5f7665 100644 --- a/content/en/synthetics/api_tests/http_tests.md +++ b/content/en/synthetics/api_tests/http_tests.md @@ -188,7 +188,12 @@ Use JavaScript assertions when standard response assertions don't meet your vali
JavaScript capabilities are not supported for API tests in Windows private locations.
-**Note:** If a failed JavaScript assertion's error message might include sensitive data, enable **Do not save response body** under **Advanced Options** > **Privacy**. This truncates the assertion error message. +
+
    +
  • JavaScript capabilities are not supported for API tests in Windows private locations.
  • +
  • If a failed JavaScript assertion's error message might include sensitive data, under Advanced Options > Privacy, enable Do not save response body. This truncates the assertion error message.
  • +
+
#### Using dd.assert() From 24cf5719eda01f72840159964b422bd8cb60f300 Mon Sep 17 00:00:00 2001 From: Sami Taider Date: Thu, 21 May 2026 18:13:38 +0200 Subject: [PATCH 3/3] Update content/en/synthetics/api_tests/http_tests.md Co-authored-by: Janine Chan <64388808+janine-c@users.noreply.github.com> --- content/en/synthetics/api_tests/http_tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/synthetics/api_tests/http_tests.md b/content/en/synthetics/api_tests/http_tests.md index eb8eb5f7665..9a0ee3995dc 100644 --- a/content/en/synthetics/api_tests/http_tests.md +++ b/content/en/synthetics/api_tests/http_tests.md @@ -182,7 +182,7 @@ If a test contains an assertion on the response body and the timeout limit is re Use JavaScript assertions when standard response assertions don't meet your validation needs. Synthetic Monitoring uses the [Chai assertion library][20], which provides `dd.expect()`, `dd.should`, and `dd.assert()` for flexible assertion styles. -**Note:** When working with JSON responses, use `JSON.parse(dd.response.body)` to parse the response body before accessing its properties. This is required for all assertion methods (`dd.assert()`, `dd.expect()`, and `dd.should`) when validating JSON data. +When working with JSON responses, use `JSON.parse(dd.response.body)` to parse the response body before accessing its properties. This is required for all assertion methods (`dd.assert()`, `dd.expect()`, and `dd.should`) when validating JSON data. {{< img src="synthetics/api_tests/JS_assertion.png" alt="JavaScript assertion for HTTP API test" style="width:90%;" >}}