PolymerElements / iron-input

An input with data binding
https://webcomponents.org/element/PolymerElements/iron-input
33 stars 45 forks source link

iron-input value not retrievable outside of Polymer #95

Open beta-vulgaris opened 7 years ago

beta-vulgaris commented 7 years ago

I'm writing selenium tests for a page built with Polymer. I encountered the issue that selenium is not able to read the value of neither paper-input nor iron-input. An xpath expression like //paper-input[@value="test"] fails to find the element. Also within web developer tools the value cannot be seen nor found in the dom tree.

My workaround is to add a html attribute "valuetesting" to paper-input/iron-input, which is bound to the value and which is visible in the dom tree (valuetesting$="{{myval}}") of paper-input/iron-input. However, I think by default the value should be retrievable outside of Polymer. I would suggest to set the html tag "value" on the "input" element. Do you agree?

notwaldorf commented 7 years ago

I'm not sure I understand -- the input is in the shadow DOM, and should not be accessible outside of the shadow root. Secondly, native input elements already have a value attribute, which is bound to the iron-input's bind-value property, and paper-input's value.

beta-vulgaris commented 7 years ago

Maybe it's a bit easier to illustrate it this way...: http://output.jsbin.com/qupucesewa

I declare value=... as well as valuetesting$=... However, only valuetesting is accessible through xpath.