on
12 Apr 2023
04:00 AM
- edited on
20 Oct 2026
02:02 PM
by
HannahM
Since version 1.350, the Dynatrace Synthetic Recorder supports recording elements inside open shadow DOM. For these elements, the recorder automatically creates DOM locators. If a recorded step later fails, or if the recorder can't capture the element, you can inspect the element and add or update a DOM locator manually.
After recording a Browser Clickpath, one of the following occurs:
The Synthetic Recorder can record elements located inside open shadow roots. During recording:
document.querySelector("my-button").shadowRoot.querySelector("#submit").To view the generated locators:
If no recorded locators match due to application changes or limitations, playback can fail with 1502.
To create a new locator:
| Situation | Behavior | Recommended Action |
|---|---|---|
| Closed shadow root | The recorder cannot access elements inside the closed root and records the host element instead. The step may interact with the wrong element. | Manually implement an alternative approach such as an XPath locator or JavaScript event. |
| Shadow DOM element inside an iframe that is itself inside a shadow root | Recording stops with an error (20000). | Record the surrounding steps and add the iframe interaction manually. |
| More than 15 nested shadow roots or no usable selector can be generated | Recording stops with an error (20000). | Create the step manually using a DOM locator. |
Can Dynatrace record Shadow DOM elements?
Yes. Synthetic Recorder version 350 and later can record elements inside open shadow roots and automatically generate DOM locators.
Why does my Shadow DOM step fail with error 1502?
The recorded DOM locator may no longer match the application after a UI change. Update the locator using Chrome DevTools Copy JS path.
Are closed shadow roots supported?
No. The recorder cannot inspect elements inside closed shadow roots. Alternative approaches such as JavaScript events or XPath locators may be required.
If updating the DOM locator does not resolve the issue:
📖 Synthetic Troubleshooting Map
📖 How to perform a click event using Javascript on browser clickpath synthetic monitors
📖 How to add an XPath locator in a Browser Clickpath Monitor script
📖 How to add the DOM selector on Browser click path monitors with the Dynamic iframes scenarios
@Mareeswaran Thank you for sharing this! I'm sure it will help out many community members.