SetText doesn't clear previous value

Katalon ver 5.10.1
OS : Mac OS Sierra 10.12.6

https://docs.katalon.com/katalon-studio/docs/webui-set-text.html says, “It also clears the previous value of the input field”.
But in our environment, is doesn’t clear previous value but append text to previous value.

For example,
WebUI.setText ( findTestObject (‘object1’), ‘1’)
WebUI.setText ( findTestObject (‘object1’), ‘2’)
WebUI.setText ( findTestObject (‘object1’), ‘3’)
results to set “123”, not “3”.

Can anyone reproduce this?

Yes, it’s a known problem. It varies across browsers but is essentially the same and problematic.

Your best bet here is to write your own keyword that does exactly what you expect. And when it doesn’t, you can fix it because it’s your code.

Ironic really, that the one thing an automated test is going to need (second only to “click” I guess) is set values on HTML elements.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.