Shadow-dom support for selenium
<p>I am working on an automation project which uses shadow DOMs extensively.
I use the <code>execute_script</code> function to access shadow root elements.</p>
<p>For example:</p>
<pre class="lang-py prettyprint-override"><code>root = driver.execute_script('return document.querySelector(&quot;.flex.vertical.layout&quot;).shadowRoot')
</code></pre>
<p>Then I use the root element to access the elements within.
Since we have shadow root elements at many levels, this is annoying me a lot.
Is there any better solution to access elements within shadow root elements?</p>
<p>I am using Chrome 2.20 driver.</p>