How to interact with trusted events in a Browser Clickpath Monitor

Summary

Some applications check whether an action was completed by a real user using the isTrusted property. Synthetic users don’t pass this check out of the box, so we need to update the script to change this.

Resolution

With the snippet below, Browser Clickpath Monitors can click and enter keystrokes in applications that require the events to be trusted.

  • Trusted events impact only Click and Keystroke steps; no other steps’ behavior is impacted by the flag, including JavaScript steps.
  • The trusted Click step has the following limitations:
    the click may not work when
    • An element is behind another element (overlay) like Cookie consent popup
      • Consider introducing a synthetic step to remove the overlay before proceeding with trusted events (like adding click step to accept/reject Cookie consent popup).
    • An element is inside an iframe (trusted event in iframe are supported since 1.331)

Supported Versions

This feature was added:

  • For Clicks, from 1.266 (1.266 Recorder, 1.266 Public Locations, 1.267 Synthetic-enabled ActiveGates).
  • For Keystrokes, from 1.269 (1.269 Recorder, 1.269 Public Locations, 1.269 Synthetic-enabled ActiveGates)

How to enable interacting with trusted events in a Browser Clickpath monitor

Add the following to the configuration section of the script to enable Trusted Events feature

,"experimentalProperties": [ <br>      { <br>          "name": "enableTrustedEvents", <br>          "value": "true" <br>      } <br>]

No further changes are required to the monitor. Now all click and keystroke events in the script will be considered trusted.

How to remove/ disable an experimental property

If this experimental property is no longer required, remove the property that was added:

  • Latest Dynatrace Synthetic app: Open Advanced Setup → Experimental properties and delete the property entry.
  • Classic Synthetic: Remove the corresponding code snippet from the monitor’s experimentalProperties section, or the entire experimentalProperties block if no other experimental properties are configured.

After removing the property, save the monitor and execute it again to validate that it runs successfully.

What’s Next

If this does not resolve the issue, please open a support ticket and provide

  • a link to the affected monitor
  • mention this article and any other troubleshooting steps taken

What to read next:

HannahM_0-1769097109026.png
  Script mode for Browser monitor configuration

HannahM_0-1769097109026.png
   Synthetic Troubleshooting Map

HannahM_0-1769097109026.png
  Synthetic Browser Monitor Error Codes

HannahM_0-1769097109026.png
  How to perform a click event using Javascript on browser clickpath synthetic monitors

HannahM_0-1769097109026.png
  How to inspect and add the shadow DOM elements into synthetic script events.

10 Likes