We are excited to share that we now support testing on elements within shadow DOMs!
Shadow DOMs are also known as hidden DOM trees, and they have become an increasingly popular tool for building web components. One of the challenges, however, is that elements within a shadow DOM cannot be found with traditional testing tools. To address this challenge and help teams expand their testing coverage, we have updated our find logic so that you can train steps against elements in hidden shadow DOM trees.
Mabl's shadow DOM support allows you to train steps in a shadow DOM without any extra effort. When you record steps on elements within a shadow DOM, an icon appears in the bottom right corner of the step description indicating that the action is within a shadow root.
Step targeting element in shadow DOM in the mabl Trainer
This functionality includes, but is not limited to, click steps, assertions, entering text into an element, and advanced find steps using CSS.
- Elements in a shadow DOM cannot be found using XPath IDs.
- The mabl Trainer can only target elements in open shadow DOMs.
When run in the cloud, steps that target shadow DOM start by identifying the shadow parent of the element and then locate the correct element within the shadow DOM.
Shadow DOM support is currently only available on the Unified runner for Chrome.
For more information about this feature, check out the Shadow DOM guide.