如何使用量角器或selenium在网页中的Shadow-root下的文本框中输入文本。

问题描述 投票:0回答:1

如何使用量角器或selenium在网页中的Shadow-root下的文本框中输入文本?什么都有帮助。我试图在xpath和xpath的文本字段中输入值是正确的,因为我已在控制台中验证它。

selenium xpath protractor automated-tests shadow-dom
1个回答
1
投票

只需在Web控制台中使用javascript即可使用以下命令:

document.querySelector('message-list').shadowRoot.querySelector('.textbox').querySelector('textbox').value = 'hello'

要使用appium运行它,您需要使用driver.executeScript

© www.soinside.com 2019 - 2024. All rights reserved.