search, contain, have, sub, substring, scriptless, script-less, scripted, step, view, stepview

Method Contains

Checks if the object partially contains a certain text

Watch this video to learn how to use this method

Have a problem with playback?

Usage

Function Contains( 
        String Text, 
        Long MsTimeOut [Optional],
        Boolean Report [Optional]
)

Step

ZAP Object step

Contains

ZAPTEST

1500

true

Text

MsTimeOut

Report

Parameters

Text

Type: String

Text to be checked for

MsTimeOut (optional)

Type: Long

Default Value: Global timeout value (from ZAPTEST Options)

How long to look for the text before failing in milliseconds

Report (optional)

Type: Boolean

Default Value: True

Report this step into Test Results

Returns

True if operation is successful; otherwise, false

Example

VBScript

'Let's take an object which contains string "ZAPTEST demo object".
Application("Demo").View("DemoView").Object("DemoObject").Contains("ZAPTEST") 'true
'set timeout and disable this step report to test result
Application("Demo").View("DemoView").Object("DemoObject").Contains("dummyString", 10000, false) 'false

JavaScript

// Let's take an object which contains string "ZAPTEST demo object".
Application("Demo").View("DemoView").Object("DemoObject").Contains("ZAPTEST"); // true
// set timeout and disable this step report to test result
Application("Demo").View("DemoView").Object("DemoObject").Contains("dummyString", 10000, false); // false

Comment

Check if object contains "ZAPTEST" text

Script-Less next step

Step

ZAP Object step

Contains

ZAPTEST

Script-Less next step

Comment

Set MsTimeOut and Report optional parameters

Script-Less next step

Step

ZAP Object step

Contains

ZAPTEST

30000

false

Contact Us

3150 Roswell Rd NW

Atlanta, GA, 30305, USA

(800) 795-3552