It really took me a while to figure that out and i hope this is helpful to anyone who tries to reach elements with Kantu that are inside Shadow-root elements. So far i tested in Chrom and Edge and it worked fine.
The solution is using javascript with the kanut “execute” command.
I used the following test shadow-root website to show the solution: http://watir.com/examples/shadow_dom.html
I never have faced this kind of challenge so I can’t give you an answer for this. But if you find out, please post this back here. I might need that in the future.
I found the following code on that addresses this problem. It works when run in an executeScript command.
// Get the shadow host element
const shadowHost = document.querySelector(‘your-shadow-host-element’);
// Access the shadow root
const shadowRoot = shadowHost.shadowRoot;
// If the shadow root is open, you can access its elements
if (shadowRoot) {
const elementInsideShadowRoot = shadowRoot.querySelector(‘element-selector’);
// Do something with the element
} else {
// The shadow root is closed, you can’t access it directly
}