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

**URL:** <https://community.dynatrace.com/t/how-to-inspect-and-add-shadow-dom-elements-into-browser-clickpath-script-events/39184>\
**Category:** Troubleshooting\
**Tags:** browser-monitors, synthetic-monitoring\
**Created:** [April 12, 2023, 3:00am UTC](https://community.dynatrace.com/t/how-to-inspect-and-add-shadow-dom-elements-into-browser-clickpath-script-events/39184 "2023-04-12T03:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mareeswaran](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@Mareeswaran](https://community.dynatrace.com/u/Mareeswaran)\
**Post date:** [April 12, 2023, 3:00am UTC](https://community.dynatrace.com/t/how-to-inspect-and-add-shadow-dom-elements-into-browser-clickpath-script-events/39184/1 "2023-04-12T03:00:00Z")

</div>

_Summary: The Dynatrace Synthetic Recorder extension doesn’t support recording shadow DOM elements.&nbsp;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&nbsp;[How to perform click event with help of Javascript on browser click path synthetic monitor incase of…,](https://community.dynatrace.com/topic/244503)&nbsp;or try using an XHR locator instead,&nbsp;[How to add an XPath locator in a Browser Clickpath Monitor script](https://community.dynatrace.com/topic/214051)

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](https://global.discourse-cdn.com/dynatrace/original/3X/e/b/eb6d9d4379a236243b3b08861f33a5d309710d6d.png)  
[Synthetic Troubleshooting Map](https://community.dynatrace.com/topic/250426)

![HannahM_0-1769097109026.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/b/eb6d9d4379a236243b3b08861f33a5d309710d6d.png)  
&nbsp;&nbsp;[How to perform a click event using Javascript on browser clickpath synthetic monitors](https://community.dynatrace.com/topic/244503)

![HannahM_0-1769097109026.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/b/eb6d9d4379a236243b3b08861f33a5d309710d6d.png)  
&nbsp;&nbsp;[How to add an XPath locator in a Browser Clickpath Monitor script](https://community.dynatrace.com/topic/214051)

![HannahM_0-1769097109026.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/b/eb6d9d4379a236243b3b08861f33a5d309710d6d.png)  
&nbsp;&nbsp;[How to add the DOM selector on Browser click path monitors with the Dynamic iframes scenarios](https://community.dynatrace.com/topic/209499)

![HannahM_0-1769097109026.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/b/eb6d9d4379a236243b3b08861f33a5d309710d6d.png)  
&nbsp;&nbsp;[Synthetic Browser Monitor Error Codes](https://community.dynatrace.com/topic/198177)

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [May 12, 2023, 7:11pm UTC](https://community.dynatrace.com/t/how-to-inspect-and-add-shadow-dom-elements-into-browser-clickpath-script-events/39184/2 "2023-05-12T19:11:33Z")

</div>

[@Mareeswaran](https://community.dynatrace.com/user/40562)&nbsp;&nbsp;Thank you for sharing this! I’m sure it will help out many community members.
