title: Find element in a shadow DOM with Selenium
body: <p>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.</p>
  
  <p>My DOM:</p>
  
  <pre><code>&lt;iframe&gt;
    #document
      &lt;html&gt;
       &lt;body&gt;
         &lt;div&gt;
           &lt;div&gt;
             &lt;div id="reality-check-period"&gt;
  
             &lt;/div&gt;
           &lt;/div&gt;
         &lt;/div&gt;
      &lt;/body
     &lt;/html&gt;
  &lt;/iframe&gt;
  </code></pre>
  
  <p>I was able to find the iframe, but i need to locate the div with id 'reality-check-period'.</p>
  
  <p>Try to return with arguments[0] etc.</p>
  
  <pre><code>WebElement iframe = driver.findElement(By.tagName("iframe"))
  driver.switchTo().frame(iframe);
  </code></pre>
  
  <p>We use Chrome driver 74.0.3729.6</p>
  
  <p>Any suggestion would be appreciated.</p>
  
  <p><a href="https://i.stack.imgur.com/2yNxx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2yNxx.png" alt="enter image description here"></a></p>
  
  <p>Edit:
  As I mentioned .shadowRoot not work for me, because the DOM contains #document under the IFrame and not #shadow-root.</p>