selenium webdriver – Unable to locate an element when “show user agent shadow DOM” is enabled

enter image description here

As for the image, I need to capture an element which is under show user agent shadow DOM.

I tried using //*[@id="placeholder"], but as for the image, its Zero matches.
By looking at some other older post at this website I tried using

WebElement ele = (WebElement) ((JavascriptExecutor)driver).executeScript("return arguments[0].shadowRoot", element);

for that also, I’m not getting the element.
So Is there any other way to capture the element below the show user agent shadow DOM.

Read more here: Source link