Closed tpapaioa closed 2 months ago
Hi, Me and @swadeley also facing the same issue currently. Is there any update or any contribution that we can do ?
right now as suggested by @tpapaioa there is work around we are gonna use
cc: @RonnyPfannschmidt
When using chrome browser in selenium, calls to
TextInput.fill("")
to clear a textarea element does not work. Looking at the browser console in the selenium container, I can see that afterfill
callsclear()
on the textarea element, the element in the DOM still has the original user-entered text as its contents, even though the browser is displaying the placeholder text andel.get_attribute("value")
returns an empty string.Relevant code:
From https://github.com/webdriverio/webdriverio/discussions/7650 it sounds like using the
clear()
WebDriver method does not work well when the element is controlled by React. Becauseel.get_attribute("value")
returns an empty string, the workaround code inclear()
for chrome doesn't run.Instead of using
clear()
, it might be better (and closer to what a user would do) to usesend_keys()
to clear the text (e.g., with control-X or backspace * the length of the current value) instead ofclear()
.