【发布时间】:2021-01-04 00:51:14
【问题描述】:
I have an app structure like this:
<shell>
#shadow-root (open)
<mini-app>
#shadow-root (open)
<input id="username" autocomplete="off" name="username" type="text" aria-required="true" required="" value="">
</mini-app>
<shell>
Nested tags with shadow-root element username inside it.I want to access input element username using webdriverio.
我可以使用以下方式访问 dev 中的用户名:
let a = document.querySelector('shell')
let b = a.shadowRoot.querySelector('mini-app')
b.shadowRoot.getElementById('username')
How can i access the same using webdriverio ? I went through this `https://webdriver.io/blog/2019/02/22/shadow-dom-support.html` but the documentation looks outdated because I am unable to use shadowRoot with shadow$
Any help would be appreciated.
还有其他方法可以通过 webdriver 访问 shadow dom 元素吗?
【问题讨论】:
标签: javascript ui-automation webdriver-io shadow-dom