I am working on an automation project which uses shadow dom extensively. So every time using execute_script function to access shadow root
for eg.
root = driver.execute_script('return document.querySelector(".flex.vertical.layout").shadowRoot')
Then use the root to access the elements within. Since we have shadow roots at many levels, this is annoying me a lot. is there any better solution exist than this to access elements within shadow root?
I am using Chrome 2.20 driver.
Not sure it works in all browsers, but for me
::shadow
works fine in chromedriver 2.38 For example: