Skip to main content

[Windows] Clear Text

Description

Clear the text content of the Web element found by using locator value of the given windows object.

Keyword name: clearText

Parameters

Parameter Parameter TypeRequiredDescription
windowsObjectWindowsTestObjectYesAn object describing the locator and locator strategy to find a Windows element.

Example

"Set 'Welcome to Katalon Studio' on the edit panel"
Windows.setText(findWindowsObject("Object Repository/Edit"), 'Welcome to Katalon Studio')

"Get text of the edit panel and verify"
def text = Windows.getText(findWindowsObject("Object Repository/Edit"))

assert text == 'Welcome to Katalon Studio'

"Clear text of the edit panel"
Windows.clearText(findWindowsObject("Object Repository/Edit"))

"Get text of the edit panel and verify the text is clear"
text = Windows.getText(findWindowsObject("Object Repository/Edit"))

assert text == 'Welcome to Katalon Studio'
Was this page helpful?