Gaurav Budhori
Gaurav Budhori

Reputation: 3

How to input text in a textbox that is under Shadow-root in a web page using protractor or selenium.

How to input text in a text-box that is under Shadow-root in a web page using protractor or selenium? Anything would be helpful. I am trying to enter values in a text-field with xpath and xpath is correct because I have validated it in console.

Upvotes: 0

Views: 1496

Answers (1)

Stephen Bates
Stephen Bates

Reputation: 26

Just using javascript in the web console you can use the following:

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

To run it with appium you need to use driver.executeScript

Upvotes: 1

Related Questions