【发布时间】:2022-01-14 00:08:22
【问题描述】:
我正在尝试自动化具有多个阴影元素的屏幕。例如,我必须为名为“学生姓名”的文本字段设置数据。该字段必须遍历多个阴影元素。
cy.get('app-screen)
.shadow()
.find('app-toolbar')
.shadow()
.find('student-container')
.shadow()
.find('input[id="studentName"]')
.type("Viola");
有没有可以这样指定的替代方法:
cy.get('app-screen app-toolbar student-container input[id="studentName"]').type('Viola');
我为量角器找到了类似的解决方案。赛普拉斯是否有可用的解决方案,例如添加客户定位器? Protractor: Unable select input element inside a shadow DOM (Polymer) using by.deepCss('input')
谢谢
【问题讨论】:
标签: cypress