# Missing document for WebUI.clearText(TestObject)

**URL:** <https://forum.katalon.com/t/missing-document-for-webui-cleartext-testobject/54413>\
**Category:** Miscellaneous\
**Tags:** new-doc-request\
**Created:** [May 4, 2021, 5:26am UTC](https://forum.katalon.com/t/missing-document-for-webui-cleartext-testobject/54413 "2021-05-04T05:26:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 4, 2021, 5:26am UTC](https://forum.katalon.com/t/missing-document-for-webui-cleartext-testobject/54413/1 "2021-05-04T05:26:34Z")

</div>

I happene to find that there is no document page for the `WebUI.clearText(TestObject)` is available. Try the following:

- [https://docs.katalon.com/katalon-studio/docs/webui-clear-text.html](https://docs.katalon.com/katalon-studio/docs/webui-clear-text.html)

This link will get 404 NOT FOUND.

However, `com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords` class surely implements `clearText(TestObject)` method. See the source code:

[https://github.com/katalon-studio/katalon-studio-testing-framework/blob/master/Include/scripts/groovy/com/kms/katalon/core/webui/keyword/WebUiBuiltInKeywords.groovy](https://github.com/katalon-studio/katalon-studio-testing-framework/blob/master/Include/scripts/groovy/com/kms/katalon/core/webui/keyword/WebUiBuiltInKeywords.groovy)

And I checked the following Test Case, and confirmed that the `WebUI.clearText()` works:

```auto
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable

WebUI.comment('Story: Login to CURA system')
WebUI.comment('Given that the user has the valid login information')
WebUI.openBrowser(GlobalVariable.G_SiteURL)
WebUI.click(findTestObject('Page_CuraHomepage/btn_MakeAppointment')
WebUI.setText(findTestObject('Page_Login/txt_UserName'), "Fake Name")
WebUI.delay(3)

WebUI.clearText(findTestObject('Page_Login/txt_UserName'))

WebUI.delay(3)
WebUI.setText(findTestObject('Page_Login/txt_UserName'), Username)
WebUI.setText(findTestObject('Page_Login/txt_Password'), Password)
WebUI.comment('When he logins to CURA system')
WebUI.click(findTestObject('Page_Login/btn_Login'))
WebUI.comment('Then he should be able to login successfully')
landingPage = WebUI.verifyElementPresent(findTestObject('Page_CuraAppointment/div_Appointment'), GlobalVariable.G_Timeout)
WebUI.closeBrowser()

```

There seems to be no reason why we do not have a document for the `WebUI.clearText()` keyword.

@duyluong  
@ThanhTo

Why not?

* * *

There are quite a few questions in this forum, which asked “how to clear text?”. I suppose they were lost because they could not find the doc for WebUI.clearText.

- [How to clear textbox?](http://forum.katalon.com/t/how-to-clear-textbox/6280)
- [Katalon takes old text even after clearing the field and passing new text to the field](http://forum.katalon.com/t/katalon-takes-old-text-even-after-clearing-the-field-and-passing-new-text-to-the-field/43448)
- [Is there any inbuilt function to get the text boxes clear?](http://forum.katalon.com/t/is-there-any-inbuilt-function-to-get-the-text-boxes-clear/32342)

---

<div class="post-metadata">

**Author:** ![ThanhTo](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thanhto/32/697_2.png) [@ThanhTo](https://forum.katalon.com/u/ThanhTo)\
**Post date:** [May 4, 2021, 2:45pm UTC](https://forum.katalon.com/t/missing-document-for-webui-cleartext-testobject/54413/2 "2021-05-04T14:45:03Z")

</div>



---

<div class="post-metadata">

**Author:** ![Shin](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/shin/32/16552_2.png) [@Shin](https://forum.katalon.com/u/Shin)\
**Post date:** [May 5, 2021, 3:19am UTC](https://forum.katalon.com/t/missing-document-for-webui-cleartext-testobject/54413/3 "2021-05-05T03:19:30Z")

</div>

Hi @kazurayam,

Thank you for your feedback, we will take a look and improve the document for `WebUI.clearText(TestObject)` asap. Stay tuned!

Shin

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 24, 2021, 2:07pm UTC](https://forum.katalon.com/t/missing-document-for-webui-cleartext-testobject/54413/4 "2021-05-24T14:07:18Z")

</div>

It was reported that `WebUI.clearText()` does not work for a `<input type="number">`

```auto
<input type="number" id="quantity" name="quantity" min="1" max="5">

```

See for example

- [How to clear() input fields in web?](http://forum.katalon.com/t/how-to-clear-input-fields-in-web/8549/9)

We can guess and understand this mess. A `<input type="number">` requires a text value to be a number. Now a question arises. Having blank in the field – is it legal? Is a blank a number?

Well, principally, a blank is not number, a blank should be avoided there.

Then how browsers should react when Katalon Studio called `WebUI.clearText()` for a `<input type="number">` element?

Well, there would be no clear-cut answer. Browsers may behave in various manner.

- turn the field blank
- turn it to be the minimum value, or the maximum value, or 0
- just ignore the clearText() request

A possible approach would be saying that “you should not use WebUI.clearText() for `<input type="number">` as the result is not deterministic”

Katalon should explain in the official document something to avoid confusion.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [October 2, 2021, 12:29am UTC](https://forum.katalon.com/t/missing-document-for-webui-cleartext-testobject/54413/5 "2021-10-02T00:29:31Z")

</div>

No improvement has been done yet.
