How to inspect and add shadow DOM elements into Browser clickpath script events.

Summary: The Dynatrace Synthetic Recorder extension doesn’t support recording shadow DOM elements. To accommodate this, the locator must be updated in the Browser clickpath.

Problem

After recording a Browser clickpath, some events fail with errors like ‘1502 - The html element could not be found to perform action’. On inspecting the element, it is found that it is within a ShadowDOM, #shadowroot.

Resolution

  1. Go to the relevant page on a Chrome browser

  2. Right-click on the element that you want to interact with on the page and select Inspect. This will open the element in the developer tools

  3. Right-click on the element on the Web developer tools - > Copy - > Copy JS path

  4. Add this copied DOM selector into your synthetic script events as a type of DOM selector.

What’s Next

If this doesn’t work, it may be that you need to try a different locator or to fire some events, see How to perform click event with help of Javascript on browser click path synthetic monitor incase of…, or try using an XHR locator instead, How to add an XPath locator in a Browser Clickpath Monitor script

If you still need assistance, open a chat or support ticket and provide a link to the affected monitor and explain what your are trying to do and what you have already tried.

What to read next:

HannahM_0-1769097109026.png
Synthetic Troubleshooting Map

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

HannahM_0-1769097109026.png
  How to add an XPath locator in a Browser Clickpath Monitor script

HannahM_0-1769097109026.png
  How to add the DOM selector on Browser click path monitors with the Dynamic iframes scenarios

HannahM_0-1769097109026.png
  Synthetic Browser Monitor Error Codes

9 Likes

@Mareeswaran  Thank you for sharing this! I’m sure it will help out many community members.

2 Likes