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访问卷影dom元素?
发布于 2020-09-17 15:47:23
文档看起来很好,你能展示一下你是如何使用卷影$ method的吗?
我相信这很简单
$('shell').shadow$('.mini-app').shadow$('#username')应该行得通
https://stackoverflow.com/questions/63932758
复制相似问题