get, text, objecttext, content, objectcontent, getcontent, scriptless, script-less, scripted, step, view, stepview

Method GetText

Retrieves visible text from object

Watch this video to learn how to use this method

Have a problem with playback?

Usage

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

Step

ZAP Object step

GetText

False

False

text

Boolean AlternativeMethod [Optional]

Report

Output Parameter

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);
}

Comment

Get text from object

Script-Less next step

Step

ZAP Object step

GetText

val

Script-Less next step

Comment

Use alternative method to get text from object

Script-Less next step

Step

ZAP Object step

GetText

True

True

text

Contact Us

3150 Roswell Rd NW

Atlanta, GA, 30305, USA

(800) 795-3552