fbpx

Method GetText

Retrieves visible text from object

Usage

Function GetText( 
    Boolean AlternativeMethod [Optional],
    Boolean Report [Optional]
)

Parameters

AlternativeMethod (optional)

Type: Boolean

Default value: False

Uses an alternative method to get text from object. Set this parameter to true if normal method does not provide adequate results

Report (optional)

Type: Boolean

Default Value: False

Generate report for this step

Returns

Result text string or empty string if text was not found

Example

VBScript

objectText = Application("Demo").View("DemoView").Object("DemoTextObject")GetText()
If objectText = "" Then
    'try to get text from object using alternative method
    objectText = Application("Demo").View("DemoView").Object("DemoTextObject")GetText(true, true)
End If

JavaScript

var objectText = Application("Demo").View("DemoView").Object("DemoTextObject").GetText();
if (objectText == "") {
    // try to get text from object using alternative method
    objectText = Application("Demo").View("DemoView").Object("DemoTextObject").GetText(true, true);
}

Documentation Categories

ZAPTEST

FARM

LOAD