I happene to find that there is no document page for the WebUI.clearText(TestObject)
is available. Try the following:
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:
And I checked the following Test Case, and confirmed that the WebUI.clearText()
works:
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.
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.