Textarea not returning the text value with Wallaby

I’m trying to retrieve the text value from a textarea element but haven’t been able to do it yet. I can bring the selection down to the level of the Element, I can clear() the Element, and I can send_keys() to the Element. But using Element.text/1 or Browser.text/1 or Browser.text/2 only returns “” as if the element isn’t visible.

The textarea element is defined by a list of classes but it has no name, for, or id attributes.

The initial text it contains is populated by an API call so I tried to use assert_has/2 to cause it to wait till the text is populated, but the test just pauses. And even if I have cleared and sent new keys to it, I cannot retrieve that text either. Any ideas?

guessing, but try https://hexdocs.pm/wallaby/Wallaby.Element.html#value/1

1 Like

Wow - that was it. I must’ve had tunnel vision to not have seen it. Thanks!

1 Like