iron-input icon indicating copy to clipboard operation
iron-input copied to clipboard

iron-input value not retrievable outside of Polymer

Open beta-vulgaris opened this issue 8 years ago • 2 comments

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?

beta-vulgaris avatar Dec 21 '16 17:12 beta-vulgaris

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.

notwaldorf avatar Apr 17 '17 23:04 notwaldorf

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.

beta-vulgaris avatar Apr 19 '17 11:04 beta-vulgaris