We use shadowDOM fairly extensively in our codebase, and wanted to automate a suite of tests using agouti. However - I'm hitting a major blocker accessing any DOM elements within the shadow root on the page.
It's not part of the webdriver spec, so not that surprising that there's no built in behaviour for this - the common workaround seems to be running custom javascript to explore the DOM / find elements.
Eventually(func() string {
var result string
p.RunScript(
`return document.querySelector("some-element").shadowRoot.querySelector("target-element"),
nil,
&result,
)
return result
}).Should(Equal("wat"))
However, it seems to return nothing, and i can't find any way of getting an *agouti.Selection out of the javascript return.
Hi,
We use shadowDOM fairly extensively in our codebase, and wanted to automate a suite of tests using agouti. However - I'm hitting a major blocker accessing any DOM elements within the shadow root on the page.
It's not part of the webdriver spec, so not that surprising that there's no built in behaviour for this - the common workaround seems to be running custom javascript to explore the DOM / find elements.
E.G
I've tried doing this through the RunScript API -
However, it seems to return nothing, and i can't find any way of getting an *agouti.Selection out of the javascript return.
Is there any way to achieve this?