I'm new with Selenium, just try to help the tester guy. We try to find an element in shadow-dom with Selenium but Selenium don't find it. I tried other post's solutions, but thats didn't work for me either.
My DOM:
<iframe>
#document
<html>
<body>
<div>
<div>
<div id="reality-check-period">
</div>
</div>
</div>
</body
</html>
</iframe>
I was able to find the iframe, but i need to locate the div with id 'reality-check-period'.
Try to return with arguments[0] etc.
WebElement iframe = driver.findElement(By.tagName("iframe"))
driver.switchTo().frame(iframe);
We use Chrome driver 74.0.3729.6
Any suggestion would be appreciated.
Edit: As I mentioned .shadowRoot not work for me, because the DOM contains #document under the IFrame and not #shadow-root.