Skip to main content

[Windows] Get Text

Description

Get the text content of the Web element found by using the locator value of the given Windows object. This action appends the given text on the element without clearing its current text.

Keyword name: getText

Parameters

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

Returns

Parameter TypeDescription
StringThe text content of the found 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'